Skip to content

Commit

Permalink
Add occ todos / comments (#317)
Browse files Browse the repository at this point in the history
This adds some comments with some useful code pointers for existing
logic and discussing future OCC work

NA
  • Loading branch information
udpatil committed Jan 18, 2024
1 parent f922f80 commit 933afd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [
storeAccessOpEvents := msCache.GetEvents()
accessOps := ctx.TxMsgAccessOps()[acltypes.ANTE_MSG_INDEX]

// TODO: (occ) This is an example of where we do our current validation. Note that this validation operates on the declared dependencies for a TX / antehandler + the utilized dependencies, whereas the validation
missingAccessOps := ctx.MsgValidator().ValidateAccessOperations(accessOps, storeAccessOpEvents)
if len(missingAccessOps) != 0 {
for op := range missingAccessOps {
Expand Down Expand Up @@ -1106,6 +1107,8 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s
storeAccessOpEvents := msgMsCache.GetEvents()
accessOps := ctx.TxMsgAccessOps()[i]
missingAccessOps := ctx.MsgValidator().ValidateAccessOperations(accessOps, storeAccessOpEvents)
// TODO: (occ) This is where we are currently validating our per message dependencies,
// whereas validation will be done holistically based on the mvkv for OCC approach
if len(missingAccessOps) != 0 {
for op := range missingAccessOps {
ctx.Logger().Info((fmt.Sprintf("eventMsgName=%s Missing Access Operation:%s ", eventMsgName, op.String())))
Expand Down
2 changes: 2 additions & 0 deletions store/cachekv/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator {
defer store.mtx.Unlock()
// TODO: (occ) Note that for iterators, we'll need to have special handling (discussed in RFC) to ensure proper validation

// TODO: (occ) Note that for iterators, we'll need to have special handling (discussed in RFC) to ensure proper validation

var parent, cache types.Iterator

if ascending {
Expand Down

0 comments on commit 933afd4

Please sign in to comment.