-
Notifications
You must be signed in to change notification settings - Fork 69
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
refactor deferred balance to use memkv #287
Conversation
938f3c0
to
0627520
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #287 +/- ##
==========================================
- Coverage 55.17% 54.93% -0.25%
==========================================
Files 619 618 -1
Lines 51569 51531 -38
==========================================
- Hits 28455 28310 -145
- Misses 21063 21169 +106
- Partials 2051 2052 +1
|
@@ -970,7 +970,7 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, txBytes []byte) (gInf | |||
// Dont need to validate in checkTx mode | |||
if ctx.MsgValidator() != nil && mode == runTxModeDeliver { | |||
storeAccessOpEvents := msCache.GetEvents() | |||
accessOps, _ := app.anteDepGenerator([]acltypes.AccessOperation{}, tx) | |||
accessOps := ctx.TxMsgAccessOps()[acltypes.ANTE_MSG_INDEX] |
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.
cc @BrandonWeng is there a specific reason you have previously called the dependency generator here? I assume it was because you may not have been aware that the -1
key was reserved for the access ops generated for the ante handler ahead of time? but just want to make sure there wasnt some other reason
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.
Teah that was most likely the case
types/accesscontrol/comparator.go
Outdated
@@ -21,6 +21,9 @@ var ( | |||
} | |||
) | |||
|
|||
// use -1 to indicate that it is prior to msgs in the tx |
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.
nit: What is prior to messages in the transaction?
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 ante handler, since that also needs to declare resource usages. When constructing the DAG, we generate the dependencies on a per message basis, so for simplicity we treat the antehandler as the -1st
message in the list of messages
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.
Sorry, I meant the godoc should be updated to reflect that :p
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.
ah yeah, will do
e5067f1
to
85b0d5f
Compare
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.
not a blocker for this PR but could we add some unit tests for the error cases? the happy paths are tested quite well already
|
||
deferredStore := d.getModuleTxIndexedStore(ctx, moduleAddr, txIndex) | ||
// Bank invariants require to not store zero balances, so we follow the same pattern in deferred cache. | ||
if balance.IsZero() { |
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.
nit but could we add unit tests for failure scenarios? The happy paths seem to be covered quite well already. Not a blocker for this PR
Describe your changes and provide context
This PR does the following:
Still in progress:
Testing performed to validate your change
local sei testing + adding more unit tests