-
Notifications
You must be signed in to change notification settings - Fork 838
chore(customrawdb): delete customrawdb package and switch to avalanchego imports #4626
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
base: master
Are you sure you want to change the base?
Conversation
…ego imports resolves #1302 Signed-off-by: Tsvetan Dimitrov (tsvetan.dimitrov23@gmail.com)
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 (3b08d61), which likely changed behavior that made the test fail specifically for Firewood scheme, while HashScheme continued to pass.
- 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").
96abb67 to
831d8f3
Compare
831d8f3 to
98a81dc
Compare
| "github.com/ava-labs/libevm/triedb" | ||
| ) | ||
|
|
||
| var ( |
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.
If adding these sentinel errors here adds noise to the PR, I will revert them.
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.
I'd say any cosmetic/style changes here should be reverted as this is a modified-upstream code, and we should not further modify it.
ceyonur
left a comment
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.
just some cleanup from this PR. otherwise lgtm
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.
do we require this change for this PR?
| "github.com/ava-labs/libevm/triedb" | ||
| ) | ||
|
|
||
| var ( |
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.
I'd say any cosmetic/style changes here should be reverted as this is a modified-upstream code, and we should not further modify it.
Why this should be merged
Check #4569
How this works
graft/coreth/plugin/evm/customrawdb.github.com/ava-labs/avalanchego/vms/evm/sync/customrawdbimport instead.How this was tested
existing UT
Need to be documented?
no
Need to update RELEASES.md?
no
resolves #4569
Signed-off-by: Tsvetan Dimitrov (tsvetan.dimitrov23@gmail.com)