-
Notifications
You must be signed in to change notification settings - Fork 7
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
Initial implementation of IBC Precompile #37
Conversation
7fb6ed5
to
8afb4f7
Compare
func (s *StateDB) Context() context.Context { | ||
// s.ctx.CurrentCtx() replaced s.ctx after rebasing | ||
// TODO(yevhenii): is it correct? | ||
return s.ctx.CurrentCtx() |
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.
Yup this is the correct ctx of the active snapshot to use for making state changes
x/evm/statedb/statedb.go
Outdated
@@ -464,3 +472,12 @@ func (s *StateDB) SetError(err error) { | |||
|
|||
s.sdkError = err | |||
} | |||
|
|||
func (s *StateDB) IBCTransfer(goCtx context.Context, msg *ibctransfertypes.MsgTransfer) (*ibctransfertypes.MsgTransferResponse, error) { |
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.
It feels a bit out of place for IBCTransfer()
to be in the statedb, but does seem to make it easier to add access to the keepers without breaking more things in geth.
To me I think it makes a bit more sense to pass in additional keepers to geth vm.NewEVM()
then provide the matching keeper interface in contract.accessibleState
. Since it doesn't seem needed by StateDB or the Ethermint keepers? (pls correct me if wrong)
Just cuts out an extra step passing the keepers around like so:
Kava -> Ethermint -> EVM -> Custom precompile
Kava -> EVM -> Custom precompile
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.
sounds reasonable, the only downside is changing func NewEVM(...) *EVM
signature will be a bit painful, it's widely used across go-ethereum codebase (40 direct occurrences)
cc @nddeluca
d5fc637
to
457e857
Compare
457e857
to
f6c748c
Compare
@Mergifyio refresh |
✅ Pull request refreshed |
Based on #32