-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix incorrect prune state of a signed_block issue #10344
Conversation
Don't forget to back-port to 2.1 |
@@ -186,7 +186,7 @@ | |||
Utils.Print("Post light validation waiting info for each node:\nproducer: {}\nfull: {},\nlight: {}".format(json.dumps(pvnPostInfo, indent=1), json.dumps(fvnPostInfo, indent=1), json.dumps(lvnPostInfo, indent=1))) | |||
Utils.Print("Post full validation waiting info for each node:\nproducer: {}\nfull: {},\nlight: {}".format(json.dumps(pvnPost2Info, indent=1), json.dumps(fvnPost2Info, indent=1), json.dumps(lvnPost2Info, indent=1))) | |||
|
|||
assert not headAdvanced, "the full validation node is still syncing" | |||
assert (not headAdvanced) or (fvnPost2Info["head_block_num"] < cfTrxBlockNum), "the full validation node is still syncing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were these two additions needed? waitForHeadToAdvance()
should be enough, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It happened locally for full validation node that headAdvanced was true
but the node hadn't synced up to the pruned block yet. Similar to the light validation node, its headAdvanced was false
but the node had already passed the pruned block. I think we should treat these situations as success not failure so I added two extra conditions. I might be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that makes sense.
Change Description
The variable
prune_state
in asigned_block
should be updated after some trxs in the block get pruned that happens inprune_trxs()
. Otherwise in some situationto_signed_block_v0()
will try to convert asigned_block
with pruned trxs to asigned_block_v0
, which is not supposed to, due to incorrect state of the variable.Change Type
Select ONE:
Testing Changes
Select ANY that apply:
Consensus Changes
API Changes
Documentation Additions