Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Block Production Trigger #50

Closed
Voxelot opened this issue Nov 3, 2021 · 2 comments · Fixed by #599
Closed

Configurable Block Production Trigger #50

Voxelot opened this issue Nov 3, 2021 · 2 comments · Fixed by #599
Assignees
Labels
enhancement New feature or request

Comments

@Voxelot
Copy link
Member

Voxelot commented Nov 3, 2021

Currently, blocks are produced instantly when transactions are submitted. In order to support multi-tx blocks, we need a configuration mechanism to enable/disable different block production triggers on startup.

e.g. fuel-core run --block-production-mode interval or fuel-core run --block-production-mode instant

This task should cover the implementation of the following block production options:

interval Timer-based: For simulating consensus block delays, the timer trigger will fire a block production event on a configurable interval
instant Instant trigger: For integration testing contracts etc, make the tx pool trigger a block production event every time a tx is inserted.
none No block production: For passive nodes that simply listen for blocks

pos mode will be deferred to a later task.

@Voxelot Voxelot added the enhancement New feature or request label Nov 3, 2021
@Voxelot Voxelot changed the title Scheduled Block Production Configurable Block Production Trigger Jul 8, 2022
@Voxelot Voxelot added this to the Multi-Transaction Blocks milestone Jul 8, 2022
@Dentosal Dentosal self-assigned this Sep 9, 2022
@Dentosal
Copy link
Member

Dentosal commented Sep 9, 2022

For proof-of-authority network, should there exist a hybrid mode of interval and instant, similar to e.g. Nagle's algorithm?

We have three timers, with following expiration times:

  • A: Maximum block time
  • B: Minimum allowed block time
  • C: Maximum transaction idle time (shorter than A)

When a block is produced, restart timers A and B and clear timer C.
When a new transaction arrives, if timer C is not running, start it.
When either of timers A or C expires, produce a new block.
When a block is full and B has expired, produce a new block.

This way. we can produce new blocks faster than some fixed interval, but still include multiple transactions per block. The last timer, C, makes sure we will not produce blocks too quickly, so other nodes can still keep up.

@Voxelot
Copy link
Member Author

Voxelot commented Sep 10, 2022

This sounds great, and would also be useful in a rollup configuration without PoS. It helps avoid long strings of empty blocks when there's low activity.

@Voxelot Voxelot removed this from the Multi-Transaction Blocks milestone Sep 13, 2022
ControlCplusControlV pushed a commit that referenced this issue Jan 15, 2023
* Update author.

* Add more fields.

* Update author.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants