chore(customrawdb): delete customrawdb package and switch to avalanchego imports#1319
chore(customrawdb): delete customrawdb package and switch to avalanchego imports#1319powerslider wants to merge 28 commits intomasterfrom
Conversation
…ego imports resolves #1302 Signed-off-by: Tsvetan Dimitrov (tsvetan.dimitrov23@gmail.com)
e96e06d to
faad5d5
Compare
JonathanOppenheimer
left a comment
There was a problem hiding this comment.
Difference in this repository looks good - IMO, should not be merged until there's master commit that can be referenced.
|
Added a DO NOT MERGE label until ava-labs/avalanchego#4387 is merged. |
|
I will review post AvalancheGo merger and when this PR is updated! |
|
@powerslider that PR is merged! |
Signed-off-by: Tsvetan Dimitrov <tsvetan.dimitrov23@gmail.com>
No longer approve in it's current state.
Handle database.ErrNotFound returned by ReadSyncRoot when there's no previous sync root. This is expected for fresh databases and should be treated as an empty hash (no previous sync) rather than an error.
Handle database.ErrNotFound from ReadAcceptorTip as expected case (empty hash) instead of error. This fixes VM initialization failures on fresh databases.
Update TestWipe to accept database.ErrNotFound as valid result after wipe, since ReadSnapshotBlockHash returns ErrNotFound when the marker doesn't exist.
- Move block number override fix before NewEVMBlockContext creation so GetHashFn can correctly resolve blockhash(n) when block number is overridden to n+1. This fixes TestTracingWithOverrides for Firewood scheme. - The bug was probably a pre-existing code issue where the header modification happened after creating the block context. Since GetHashFn creates a closure that captures the header reference, modifying the header afterward left the closure with stale values. This bug was exposed by the recent avalanchego update (3b08d6131a00bd55349321a58ae7e6cfcff8635e), which likely changed behavior that made the test fail specifically for Firewood scheme, while HashScheme continued to pass.
JonathanOppenheimer
left a comment
There was a problem hiding this comment.
See comments
e4b219d to
428048f
Compare
- Extract sentinel errors in journal.go for better error checking
and maintainability.
- Refactor loadSnapshot to use switch statements
for clearer control flow when validating snapshot block hash and root.
- Improve TestWipe validation logic:
- Use switch statements for consistent error handling patterns.
- Add context to error messages ("before wipe" / "after wipe").
| h := block.Header() | ||
| // Apply block number override fix before creating block context so GetHashFn | ||
| // can correctly resolve blockhash(n) when block number is overridden to n+1. | ||
| if config != nil && config.BlockOverrides != nil && config.BlockOverrides.Number.ToInt().Uint64() == h.Number.Uint64()+1 { |
There was a problem hiding this comment.
Why is this change necessary? What does it do? I suspect you have may have found a solution to a persistent flake (see #1345)
There was a problem hiding this comment.
I'd defer this to @ARR4N as he put up the fix.
There was a problem hiding this comment.
I cherry-picked these changes locally, and it didn't fix the flake.
There was a problem hiding this comment.
I defer to @ceyonur for this, but I think we should avoid making unnecessary changes in this package.
There was a problem hiding this comment.
The changes were needed, because the test broke, but I also addressed some stylistic comments from @JonathanOppenheimer
There was a problem hiding this comment.
Yeah minimal changes are ok, but I don't think you should make the stylistic changes he suggested
Why this should be merged
Check ava-labs/avalanchego#4569
How this works
plugin/evm/customrawdb.github.com/ava-labs/avalanchego/vms/evm/sync/customrawdbimport instead.How this was tested
successful build
Need to be documented?
no
Need to update RELEASES.md?
no
resolves ava-labs/avalanchego#4569
Signed-off-by: Tsvetan Dimitrov (tsvetan.dimitrov23@gmail.com)