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

Avoid chainid underflow when v = 0 #23

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

pcw109550
Copy link
Member

@pcw109550 pcw109550 commented Sep 25, 2023

This PR fixes error encountered during executing erigon snapshot based on op goerli database:

./erigon snapshots retire --datadir=op-erigon-datadir

Error:

parse transaction: invalid chainID, 18446744073709551598 (expected 420), block: 1" stack="[main.go:33 panic.go:884 snapshots_cmd.go:448 command.go:274 command.go:267 command.go:267 app.go:332 app.go:309 main.go:38 proc.go:250 asm_arm64.s:1172]"

Lets hexify 18446744073709551598 == 0xffffffffffffffee. This specific number was observed when v = 0 and try to derive chainID from v. Similar issue: testinprod-io/op-erigon#14.

v = 0 case only occur in optimism prebedrock state, and these edge case must be error handled. If v = 0, do not derive and use config's chainID. Also, store v = 0 for initializing vByte.

@pcw109550 pcw109550 self-assigned this Sep 25, 2023
@pcw109550 pcw109550 force-pushed the pcw109550/fix-chainid-underflow branch from bb275c6 to d46f7ec Compare November 1, 2023 07:41
@pcw109550 pcw109550 merged commit 442f331 into op-erigon Nov 1, 2023
1 of 3 checks passed
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