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

stagedsync: revert Sync.Run return error on bad block #12550

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Oct 30, 2024

Reverting this change because it broke the contract of ExecutionEngine.UpdateForkChoice. Previously calling executionPipeline.Run would not return error upon bad block and would eventually reach this point where we set the ForkChoiceReceipt.Status to ExecutionStatus_BadBlock. Now, however, because of this newly returned error we never reach there and the response doesn't have the correct status. Checked with @JkLondon and looks like returning this error may not be necessary.

This appeared during an Astrid run on mainnet as per the logs below. Astrid relies on a response with correctly set ExecutionStatus_BadBlock status so that it marks the block as bad and continues the chain tip sync. If the error from execution engine is anything else it is treated as an operational node error (meaning some logical/unexpected error happened) which is non-recoverable and terminates the process.

[EROR] [10-30|13:33:47.363] [4/6 Execution] Wrong trie root of block 63674880: 975d274ce135313a4a716fa3f885b5e9ba1a81fb4aee919425d95725775bc233, expected (from header): 3db744974deac3ee9963fc0c80523d0125b42705640efa6f878cc2ed7fc31c46. Block hash: c6db82a7a298a4067597f8841d354f0a0461c3c662a33dee49b3fbd2142e0844 
[WARN] [10-30|13:33:47.363] Unwinding due to incorrect root hash     to=63674879
[DBUG] [10-30|13:33:47.363] UnwindTo                                 block=63674879 block_hash=0xc6db82a7a298a4067597f8841d354f0a0461c3c662a33dee49b3fbd2142e0844 err="invalid state root hash" stack="[sync.go:171 exec3.go:1250 exec3.go:1100 stage_execute.go:164 stage_execute.go:254 default_stages.go:238 sync.go:531 sync.go:410 forkchoice.go:453 asm_amd64.s:1695]"
[INFO] [10-30|13:33:47.364] [4/6 Execution] Done Commit every block  blk=63674880 blks=1 blk/s=102.0 txs=2 tx/s=204 gas/s=0 buf=229.5KB/512.0MB stepsInDB=0.00 step=2998.5 alloc=19.2GB sys=38.7GB
[DBUG] [10-30|13:33:47.364] [4/6 Execution] DONE                     in=10.221333ms
[INFO] [10-30|13:33:47.364] [4/6 Execution] Unwind Execution         from=63674880 to=63674879
[INFO] [10-30|13:33:47.364] aggregator unwind                        step=2998 txUnwindTo=4685159753 stepsRangeInDB="accounts:0.5, storage:0.5, code:0.5, commitment:0.0, receipt:0.5, logaddrs: 0.5, logtopics: 0.5, tracesfrom: 0.5, tracesto: 0.5"
[WARN] [10-30|13:33:47.365] Cannot update chain head                 hash=0xc6db82a7a298a4067597f8841d354f0a0461c3c662a33dee49b3fbd2142e0844 err="updateForkChoice: bad block unwinding"
[EROR] [10-30|13:33:47.365] failed to update fork choice             latestValidHash=0x0000000000000000000000000000000000000000000000000000000000000000 err="updateForkChoice: bad block unwinding"
[EROR] [10-30|13:33:50.365] polygon sync crashed - stopping node     err="pos sync failed: updateForkChoice: bad block unwinding"
[INFO] [10-30|13:33:50.365] Exiting... 

@AskAlexSharov AskAlexSharov merged commit 9175435 into main Oct 31, 2024
11 checks passed
@AskAlexSharov AskAlexSharov deleted the bad-block-unwind branch October 31, 2024 02:14
@AskAlexSharov
Copy link
Collaborator

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants