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

Add StateDB IAVL consistency tests #39

Closed
wants to merge 22 commits into from

Conversation

drklee3
Copy link
Member

@drklee3 drklee3 commented Mar 9, 2024

  • Adds legacy journal based StateDB to compare with in tests
  • Fix state inconsistency by setting account on SetState()
  • Add (skipped) failing test for noop SetState() that should not modify IAVL node versions

@drklee3 drklee3 force-pushed the dl-statedb-apphash-testing branch from 0626c2c to 78aefce Compare March 9, 2024 00:07
x/evm/statedb_legacy/state_object.go Fixed Show fixed Hide fixed
x/evm/statedb_legacy/journal.go Fixed Show fixed Hide fixed
Comment on lines +49 to +52
for k := range s {
keys[i] = k
i++
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
Comment on lines +56 to +59
for k := range j.dirties {
keys[i] = k
i++
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
}

// set account number
ethAcct.SetAccountNumber(accountNumberStart + uint64(i))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
if acct.GetAccountNumber() != accountNumberStart+uint64(i) {
return fmt.Errorf(
"account number mismatch: expected %d, got %d",
accountNumberStart+uint64(i), acct.GetAccountNumber(),

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion

// Ensure there are no number gaps
for i, acct := range accounts {
if acct.GetAccountNumber() != accountNumberStart+uint64(i) {

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
}

// set account number
ethAcct.SetAccountNumber(accountNumberStart + uint64(i))

Check warning

Code scanning / gosec

Errors unhandled. Warning

Errors unhandled.
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs.

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

Successfully merging this pull request may close these issues.

1 participant