-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support simulations #10
Comments
A few possible designs to the sudo API: Design 1Introduce two new methods: enum SudoMsg {
BeforeTx {
msgs: Vec<Any>,
tx_bytes: Binary,
credential: Binary,
},
BeforeTxSim {
msgs: Vec<Any>,
tx_bytes: Binary,
// the credential isn't provided in simulation mode
},
AfterTx {},
AfterTxSim {},
} Design 2Make enum SudoMsg {
BeforeTx {
msgs: Vec<Any>,
tx_bytes: Binary,
// None if the tx is being run in the simulation mode
credential: Option<Binary>,
// whether the tx is being run in the simulation mode
simulation: bool,
},
AfterTx {
simulation: bool,
},
} Design 3Define a new enum Credential {
Bytes(Binary),
Simulation,
}
enum SudoMsg {
BeforeTx {
msgs: Vec<Any>,
tx_bytes: Binary,
credential: Credential,
},
AfterTx {
simulation: bool,
},
} |
going with option 2 option 2 seems the best considering that we can allow the credential to be
|
Currently the Ante/PostHandler don't support simulations, meaning we can't estimate gas if a tx is initiated by an AbstractAccount. We should implement proper simulation.
NOTE: we have to register relevant types in legacy amino codec, because a certain sdk AnteHandler involved in the simulation still uses amino: https://github.com/cosmos/cosmos-sdk/blob/v0.47.2/x/auth/ante/basic.go#L124-L130
Additionally, we need a custom
authcmd.GetSimulationCmd
method (see: cosmos/cosmos-sdk#16887)The text was updated successfully, but these errors were encountered: