-
Notifications
You must be signed in to change notification settings - Fork 202
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
fix(evm): Use a NibiruBankKeeper to automatically record ether balance changes on the StateDB journal #2095
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
295a2d9
statedb: add cacheing for multistore before precompile runs
Unique-Divine 80dd2d7
messy, working first version that allows for precompile reversion
Unique-Divine c624912
wip!: Save checkpoint.
Unique-Divine 7f904a0
chore: changelog
Unique-Divine efbd52e
finalize bank keeper changes
Unique-Divine a8c100e
chore changelog
Unique-Divine 0ba8c0f
reset cache
Unique-Divine 08a73ee
finalize bank keeper changes
Unique-Divine 717ce1c
revert to previous commit 7f904a07ac4d5555d8c088411024fc50ff65d085
Unique-Divine 04a6897
fix strange ignored file issue
Unique-Divine 17df448
fix strange ignored file issue
Unique-Divine 7c34423
remove new bank keeper
Unique-Divine 4e3bf3c
chore: comments from self-review
Unique-Divine 8056328
chore: changelo g
Unique-Divine cc6a6a9
Merge branch 'ud/db-cache' into ud/db-cache2-bank
Unique-Divine c4ca8a2
fix(deps): update bank module to remove concrete type assertion on Ap…
Unique-Divine 6a64e47
Merge branch 'main' into ud/db-cache2-bank
Unique-Divine 70b6e5e
chore: merge conflicts
Unique-Divine 53e8c59
revert experiment
Unique-Divine 9f7160b
Merge branch 'main' into ud/db-cache2-bank
Unique-Divine a04fd06
finishing touch
Unique-Divine 9aa3a64
fix incorrect arugmetn
Unique-Divine 18892d2
feat(evmtest-erc20: Add optional descriptions to the assertions
Unique-Divine c88e9c5
Merge branch 'main' into ud/db-cache2-bank
Unique-Divine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,6 @@ type AppKeepers struct { | |
} | ||
|
||
type privateKeepers struct { | ||
bankBaseKeeper bankkeeper.BaseKeeper | ||
capabilityKeeper *capabilitykeeper.Keeper | ||
slashingKeeper slashingkeeper.Keeper | ||
crisisKeeper crisiskeeper.Keeper | ||
|
@@ -271,14 +270,17 @@ func (app *NibiruApp) InitKeepers( | |
govModuleAddr, | ||
) | ||
|
||
app.bankBaseKeeper = bankkeeper.NewBaseKeeper( | ||
appCodec, | ||
keys[banktypes.StoreKey], | ||
app.AccountKeeper, | ||
BlockedAddresses(), | ||
govModuleAddr, | ||
) | ||
app.BankKeeper = app.bankBaseKeeper | ||
nibiruBankKeeper := &evmkeeper.NibiruBankKeeper{ | ||
BaseKeeper: bankkeeper.NewBaseKeeper( | ||
appCodec, | ||
keys[banktypes.StoreKey], | ||
app.AccountKeeper, | ||
BlockedAddresses(), | ||
govModuleAddr, | ||
), | ||
StateDB: nil, | ||
} | ||
app.BankKeeper = nibiruBankKeeper | ||
app.StakingKeeper = stakingkeeper.NewKeeper( | ||
appCodec, | ||
keys[stakingtypes.StoreKey], | ||
|
@@ -374,16 +376,17 @@ func (app *NibiruApp) InitKeepers( | |
), | ||
) | ||
|
||
app.EvmKeeper = evmkeeper.NewKeeper( | ||
evmKeeper := evmkeeper.NewKeeper( | ||
appCodec, | ||
keys[evm.StoreKey], | ||
tkeys[evm.TransientKey], | ||
authtypes.NewModuleAddress(govtypes.ModuleName), | ||
app.AccountKeeper, | ||
app.BankKeeper, | ||
nibiruBankKeeper, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Written this way to make sure the EVM keeper and its constructor have the stronger typed |
||
app.StakingKeeper, | ||
cast.ToString(appOpts.Get("evm.tracer")), | ||
) | ||
app.EvmKeeper = &evmKeeper | ||
|
||
// ---------------------------------- IBC keepers | ||
|
||
|
@@ -631,7 +634,7 @@ func (app *NibiruApp) initAppModules( | |
), | ||
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), | ||
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), | ||
bank.NewAppModule(appCodec, app.bankBaseKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), | ||
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), | ||
capability.NewAppModule(appCodec, *app.capabilityKeeper, false), | ||
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), | ||
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), | ||
|
@@ -657,7 +660,7 @@ func (app *NibiruApp) initAppModules( | |
ica.NewAppModule(&app.icaControllerKeeper, &app.icaHostKeeper), | ||
ibcwasm.NewAppModule(app.WasmClientKeeper), | ||
|
||
evmmodule.NewAppModule(&app.EvmKeeper, app.AccountKeeper), | ||
evmmodule.NewAppModule(app.EvmKeeper, app.AccountKeeper), | ||
|
||
// wasm | ||
wasm.NewAppModule( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The function is renamed from
StateDB
toNewStateDB
everywhere to reflect that fact that it's not a getter for an existingStateDB
and instead generates and returns a new pointer for aStateDB
with a fresh journal