Avoids circular dependency related to block creation between Consensus and Execution#3111
Avoids circular dependency related to block creation between Consensus and Execution#3111diegoximenes wants to merge 82 commits into
Conversation
62b24dd to
14706b8
Compare
f4a3574 to
1289bf9
Compare
f6e2c88 to
cce32b8
Compare
tsahee
left a comment
There was a problem hiding this comment.
Some more notes about forward/pause.
I think this is a good direction, but it touches a lot of delicate code so we'll need to be very careful with it.
0e403b0 to
e8186e4
Compare
e8186e4 to
7c71824
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3111 +/- ##
==========================================
+ Coverage 22.62% 22.67% +0.04%
==========================================
Files 387 387
Lines 58608 58664 +56
==========================================
+ Hits 13262 13304 +42
- Misses 43307 43318 +11
- Partials 2039 2042 +3 🚀 New features to boost your workflow:
|
920c0e1 to
5e70558
Compare
47ec1af to
5a1da4f
Compare
acf6c91 to
761bc1f
Compare
| sequencedMsg, err := s.execEngine.SequenceDelayedMessage() | ||
| if err != nil { | ||
| return nil, 0 | ||
| } | ||
| if sequencedMsg != nil { | ||
| return sequencedMsg, 0 | ||
| } | ||
|
|
||
| sequencedMsg, waitUntilSequencingNextBlock := s.createBlockWithRegularTxs(ctx) |
There was a problem hiding this comment.
Maybe I'm missing some context, but isn't there a possibility to starve createBlockWithRegularTxs() if Sequencer keeps getting delayed messages? Or not a problem here?
There was a problem hiding this comment.
You are right.
I will add some randomization, or alternate which kind of transaction to sequence first.
Good catch 🙂
There was a problem hiding this comment.
Strategy to address that:
- If next delayed msg to be sequence is too old:
- next will be delayed msg turn, will wait 0ms
- Else if is sequenced delayed msg turn:
- If there are normal txs to be sequenced: next will be normal tx turn, will wait 250ms
- Else if there are delayed msgs to be sequenced: next will be delayed msg turn, will wait 0ms
- Else: next will be normal tx turn, will wait 250ms
- Else is normal tx turn:
- if there are delayed msgs to be sequenced: next will be delayed msg turn, will wait 0ms
- Else If there are normal txs to be sequenced: next will be normal tx turn, will wait 250ms (or 0ms, since today we retry immediately in some scenarios, such as if the block was not created due to all txs failing)
- Else: next will be normal tx turn, will wait 250ms
Resolves NIT-3189
Avoids circular dependency related to block creation between Consensus and Execution: