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

Speculative block repeatedly restarted when near block boundary #1432

Closed
heifner opened this issue Jul 20, 2023 · 0 comments · Fixed by #1481
Closed

Speculative block repeatedly restarted when near block boundary #1432

heifner opened this issue Jul 20, 2023 · 0 comments · Fixed by #1481
Assignees
Labels
bug Something isn't working 👍 lgtm OCI Work exclusive to OCI team

Comments

@heifner
Copy link
Member

heifner commented Jul 20, 2023

When speculatively executing trxs if a block is exhausted then it is now immediately restarted via: #1319. However, when starting a speculative block we set a block deadline according to pending block time minus producer time offset. This can create very small block times. A trx then can exceed that block time but not the configured trx max time resulting in a burst of abort_block/start_block calls.

Example scenario:

  • A speculative block is created with a time limit of pending block time minus producer offset. This can be rather small depending on when a block was received and how much time was spent processing the block
  • trx exceeds block time and is rescheduled for the next block
  • abort block
  • new block created with the same time limit as the one just aborted
  • trx exceeds block time and is rescheduled for the next block
  • abort block
  • repeat until block interval is exceeded or an incoming block is applied

When not producing a block, the time limit of a block should be set to fc::time_point::maximum() since we want to allow as many speculative trxs as possible until another block is received. If the consensus max cpu or max net is exceeded then the block will be restarted as the trx/block will be considered exhausted.

@heifner heifner added the bug Something isn't working label Jul 20, 2023
@bhazzard bhazzard added 👍 lgtm OCI Work exclusive to OCI team and removed triage labels Aug 3, 2023
@BenjaminGormanPMP BenjaminGormanPMP added this to the Leap v5.0.0-rc1 milestone Aug 3, 2023
heifner added a commit that referenced this issue Aug 5, 2023
…, calculate_next_block_slot into block_timing_util
heifner added a commit that referenced this issue Aug 5, 2023
heifner added a commit that referenced this issue Aug 11, 2023
…spond to existing limit of 5secs on speculative execution on stale state.
heifner added a commit that referenced this issue Aug 11, 2023
heifner added a commit that referenced this issue Aug 14, 2023
heifner added a commit that referenced this issue Aug 14, 2023
heifner added a commit that referenced this issue Aug 14, 2023
heifner added a commit that referenced this issue Aug 15, 2023
Smarter block deadlines for speculative blocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 👍 lgtm OCI Work exclusive to OCI team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants