Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Add Tx channels to context#27

Merged
BrandonWeng merged 9 commits intomainfrom
bweng-ctx
Sep 27, 2022
Merged

Add Tx channels to context#27
BrandonWeng merged 9 commits intomainfrom
bweng-ctx

Conversation

@BrandonWeng
Copy link
Contributor

@BrandonWeng BrandonWeng commented Sep 26, 2022

Adds transaction channels to context

Had to shuffle around to avoid circular dependency but essentially moved access ops and mapDependency objects to types/, while genesis info remains in x/accessmodule/types

This PR is used in sei-protocol/sei-chain#261

@BrandonWeng BrandonWeng requested a review from udpatil September 26, 2022 09:36
Base automatically changed from acl-refactor to main September 26, 2022 15:42
@BrandonWeng BrandonWeng requested a review from codchen September 26, 2022 16:38
types/context.go Outdated
consParams *tmproto.ConsensusParams
eventManager *EventManager
priority int64 // The tx priority, only relevant in CheckTx
txCompletionChannels [][]chan interface{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how will we be using these to know when to block / signal on resource need / release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it to be a map of aclops -> []channels


txBlockingChannels MessageAccessOpsChannelMapping
txCompletionChannels MessageAccessOpsChannelMapping
messageIndex int // Used to track current message being processed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we tracking message index instead of txindex? in the other places for dependency mapping, we're indexing by the tx index, this distinction is relevant since each tx can have multiple messages as part of it.

}

// Alias for Map of MessageIndex -> AccessOperation -> Channel
type MessageAccessOpsChannelMapping = map[int]AccessOpsChannelMapping
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should map by tx index

func MsgTypeURL(msg Msg) string {
return "/" + proto.MessageName(msg)
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: newline

@BrandonWeng BrandonWeng merged commit 3a3405a into main Sep 27, 2022
@BrandonWeng BrandonWeng deleted the bweng-ctx branch September 27, 2022 22:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants