Documentation ¶
Index ¶
- func CheckSenderBalance(ctx sdk.Context, bankKeeper evmtypes.BankKeeper, sender sdk.AccAddress, ...) error
- type ContextStack
- func (cs *ContextStack) Commit()
- func (cs *ContextStack) CommitToRevision(target int) error
- func (cs *ContextStack) CurrentContext() sdk.Context
- func (cs *ContextStack) IsEmpty() bool
- func (cs *ContextStack) Reset(ctx sdk.Context)
- func (cs *ContextStack) RevertAll()
- func (cs *ContextStack) RevertToSnapshot(target int)
- func (cs *ContextStack) Snapshot() int
- type Keeper
- func (k Keeper) Account(c context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
- func (k *Keeper) AddAddressToAccessList(addr common.Address)
- func (k *Keeper) AddBalance(addr common.Address, amount *big.Int)
- func (k *Keeper) AddLog(log *ethtypes.Log)
- func (k Keeper) AddLogTransient(log *ethtypes.Log)
- func (k *Keeper) AddPreimage(_ common.Hash, _ []byte)
- func (k *Keeper) AddRefund(gas uint64)
- func (k *Keeper) AddSlotToAccessList(addr common.Address, slot common.Hash)
- func (k *Keeper) AddressInAccessList(addr common.Address) bool
- func (k *Keeper) ApplyMessage(msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ApplyMessageWithConfig(msg core.Message, tracer vm.EVMLogger, commit bool, cfg *types.EVMConfig) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumTxResponse, error)
- func (k Keeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error)
- func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (k *Keeper) CachedContextsEmpty() bool
- func (k Keeper) ChainID() *big.Int
- func (k *Keeper) ClearAccessList()
- func (k Keeper) ClearBalance(addr sdk.AccAddress) (prevBalance sdk.Coin, err error)
- func (k *Keeper) ClearStateError()
- func (k Keeper) Code(c context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error)
- func (k *Keeper) CommitCachedContexts()
- func (k Keeper) CosmosAccount(c context.Context, req *types.QueryCosmosAccountRequest) (*types.QueryCosmosAccountResponse, error)
- func (k *Keeper) CreateAccount(addr common.Address)
- func (k Keeper) Ctx() sdk.Context
- func (k Keeper) DeductTxCostsFromUserBalance(ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, ...) (sdk.Coins, error)
- func (k Keeper) DeleteAccountStorage(addr common.Address)
- func (k Keeper) DeleteCode(addr common.Address)
- func (k Keeper) DeleteState(addr common.Address, key common.Hash)
- func (k *Keeper) EVMConfig(ctx sdk.Context) (*types.EVMConfig, error)
- func (k Keeper) EmitBlockBloomEvent(ctx sdk.Context, bloom ethtypes.Bloom)
- func (k *Keeper) Empty(addr common.Address) bool
- func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock)
- func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*types.EstimateGasResponse, error)
- func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) Exist(addr common.Address) bool
- func (k *Keeper) ForEachStorage(addr common.Address, cb func(key, value common.Hash) bool) error
- func (k *Keeper) GasToRefund(gasConsumed, refundQuotient uint64) uint64
- func (k Keeper) GetAccountStorage(ctx sdk.Context, address common.Address) (types.Storage, error)
- func (k Keeper) GetAddressCodeHash(ctx sdk.Context, addr common.Address) ([]byte, bool)
- func (k *Keeper) GetBalance(addr common.Address) *big.Int
- func (k Keeper) GetBlockBloomTransient() *big.Int
- func (k *Keeper) GetCode(addr common.Address) []byte
- func (k *Keeper) GetCodeHash(addr common.Address) common.Hash
- func (k *Keeper) GetCodeSize(addr common.Address) int
- func (k Keeper) GetCoinbaseAddress(ctx sdk.Context) (common.Address, error)
- func (k *Keeper) GetCommittedState(addr common.Address, hash common.Hash) common.Hash
- func (k *Keeper) GetEthIntrinsicGas(msg core.Message, cfg *params.ChainConfig, isContractCreation bool) (uint64, error)
- func (k Keeper) GetHashFn() vm.GetHashFunc
- func (k Keeper) GetLogSizeTransient() uint64
- func (k *Keeper) GetNonce(addr common.Address) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) GetRefund() uint64
- func (k *Keeper) GetState(addr common.Address, hash common.Hash) common.Hash
- func (k Keeper) GetTxHashTransient() common.Hash
- func (k Keeper) GetTxIndexTransient() uint64
- func (k Keeper) GetTxLogsTransient(txHash common.Hash) []*ethtypes.Log
- func (k Keeper) HandleInitEvmParamsProposal(ctx sdk.Context, p *types.InitEvmParamsProposal) error
- func (k Keeper) HasInit(ctx sdk.Context) bool
- func (k *Keeper) HasStateError() bool
- func (k *Keeper) HasSuicided(addr common.Address) bool
- func (k Keeper) IncreaseLogSizeTransient()
- func (k Keeper) IncreaseTxIndexTransient()
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ModuleEnable(c context.Context, _ *types.QueryModuleEnableRequest) (*types.QueryModuleEnableResponse, error)
- func (k *Keeper) NewEVM(msg core.Message, cfg *types.EVMConfig, tracer vm.EVMLogger) *vm.EVM
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k *Keeper) PostTxProcessing(txHash common.Hash, logs []*ethtypes.Log) error
- func (k *Keeper) PrepareAccessList(sender common.Address, dest *common.Address, precompiles []common.Address, ...)
- func (k *Keeper) RefundGas(msg core.Message, leftoverGas uint64, denom string) error
- func (k Keeper) ResetAccount(addr common.Address)
- func (k *Keeper) ResetGasMeterAndConsumeGas(gasUsed uint64)
- func (k Keeper) ResetRefundTransient(ctx sdk.Context)
- func (k *Keeper) RevertToSnapshot(target int)
- func (k Keeper) SetAddressCode(ctx sdk.Context, addr common.Address, codeHash []byte)
- func (k Keeper) SetBlockBloomTransient(bloom *big.Int)
- func (k *Keeper) SetCode(addr common.Address, code []byte)
- func (k *Keeper) SetHooks(eh types.EvmHooks) *Keeper
- func (k *Keeper) SetNonce(addr common.Address, nonce uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetState(addr common.Address, key, value common.Hash)
- func (k Keeper) SetTxHashTransient(hash common.Hash)
- func (k Keeper) SetTxIndexTransient(index uint64)
- func (k *Keeper) SlotInAccessList(addr common.Address, slot common.Hash) (addressOk, slotOk bool)
- func (k *Keeper) Snapshot() int
- func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*types.QueryStorageResponse, error)
- func (k *Keeper) SubBalance(addr common.Address, amount *big.Int)
- func (k *Keeper) SubRefund(gas uint64)
- func (k *Keeper) Suicide(addr common.Address) bool
- func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) (*types.QueryTraceBlockResponse, error)
- func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*types.QueryTraceTxResponse, error)
- func (k Keeper) Tracer(msg core.Message, ethCfg *params.ChainConfig) vm.EVMLogger
- func (k Keeper) VMConfig(params types.Params, tracer vm.EVMLogger) vm.Config
- func (k Keeper) ValidatorAccount(c context.Context, req *types.QueryValidatorAccountRequest) (*types.QueryValidatorAccountResponse, error)
- func (k *Keeper) WithChainID(ctx sdk.Context)
- func (k *Keeper) WithContext(ctx sdk.Context)
- type Migrator
- type MultiEvmHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSenderBalance ¶
func CheckSenderBalance( ctx sdk.Context, bankKeeper evmtypes.BankKeeper, sender sdk.AccAddress, txData evmtypes.TxData, denom string, ) error
CheckSenderBalance validates that the tx cost value is positive and that the sender has enough funds to pay for the fees and value of the transaction.
Types ¶
type ContextStack ¶
type ContextStack struct {
// contains filtered or unexported fields
}
ContextStack manages the initial context and a stack of cached contexts, to support the `StateDB.Snapshot` and `StateDB.RevertToSnapshot` methods.
func (*ContextStack) Commit ¶
func (cs *ContextStack) Commit()
Commit commits all the cached contexts from top to bottom in order and clears the stack by setting an empty slice of cache contexts.
func (*ContextStack) CommitToRevision ¶
func (cs *ContextStack) CommitToRevision(target int) error
CommitToRevision commit the cache after the target revision, to improve efficiency of db operations.
func (*ContextStack) CurrentContext ¶
func (cs *ContextStack) CurrentContext() sdk.Context
CurrentContext returns the top context of cached stack, if the stack is empty, returns the initial context.
func (*ContextStack) IsEmpty ¶
func (cs *ContextStack) IsEmpty() bool
IsEmpty returns true if the cache context stack is empty.
func (*ContextStack) Reset ¶
func (cs *ContextStack) Reset(ctx sdk.Context)
Reset sets the initial context and clear the cache context stack.
func (*ContextStack) RevertAll ¶
func (cs *ContextStack) RevertAll()
RevertAll discards all the cache contexts.
func (*ContextStack) RevertToSnapshot ¶
func (cs *ContextStack) RevertToSnapshot(target int)
RevertToSnapshot pops all the cached contexts after the target index (inclusive). the target should be snapshot index returned by `Snapshot`. This function panics if the index is out of bounds.
func (*ContextStack) Snapshot ¶
func (cs *ContextStack) Snapshot() int
Snapshot pushes a new cached context to the stack, and returns the index of it.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper grants access to the EVM module state and implements the go-ethereum StateDB interface.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, transientKey sdk.StoreKey, paramSpace paramtypes.Subspace, ak types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, fmk types.FeeMarketKeeper, tracer string, ) *Keeper
NewKeeper generates new evm module keeper
func (Keeper) Account ¶
func (k Keeper) Account(c context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
Account implements the Query/Account gRPC method
func (*Keeper) AddAddressToAccessList ¶
AddAddressToAccessList adds the given address to the access list. If the address is already in the access list, this function performs a no-op.
func (*Keeper) AddBalance ¶
AddBalance adds the given amount to the address balance coin by minting new coins and transferring them to the address. The coin denomination is obtained from the module parameters.
func (*Keeper) AddLog ¶
AddLog appends the given ethereum Log to the list of Logs associated with the transaction hash kept in the current context. This function also fills in the tx hash, block hash, tx index and log index fields before setting the log to store.
func (Keeper) AddLogTransient ¶
SetLog sets the log for a transaction in the KVStore.
func (*Keeper) AddPreimage ¶
AddPreimage performs a no-op since the EnablePreimageRecording flag is disabled on the vm.Config during state transitions. No store trie preimages are written to the database.
func (*Keeper) AddSlotToAccessList ¶
AddSlotToAccessList adds the given (address, slot) to the access list. If the address and slot are already in the access list, this function performs a no-op.
func (*Keeper) AddressInAccessList ¶
AddressInAccessList returns true if the address is registered on the transient store.
func (*Keeper) ApplyMessage ¶
func (k *Keeper) ApplyMessage(msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error)
ApplyMessage calls ApplyMessageWithConfig with default EVMConfig
func (*Keeper) ApplyMessageWithConfig ¶
func (k *Keeper) ApplyMessageWithConfig(msg core.Message, tracer vm.EVMLogger, commit bool, cfg *types.EVMConfig) (*types.MsgEthereumTxResponse, error)
ApplyMessageWithConfig computes the new state by applying the given message against the existing state. If the message fails, the VM execution error with the reason will be returned to the client and the transaction won't be committed to the store.
Reverted state ¶
The snapshot and rollback are supported by the `ContextStack`, which should be only used inside `ApplyMessage`, because some operations has exponential computational complexity with deep stack.
Different Callers ¶
It's called in three scenarios: 1. `ApplyTransaction`, in the transaction processing flow. 2. `EthCall/EthEstimateGas` grpc query handler. 3. Called by other native modules directly.
Prechecks and Preprocessing ¶
All relevant state transition prechecks for the MsgEthereumTx are performed on the AnteHandler, prior to running the transaction against the state. The prechecks run are the following:
1. the nonce of the message caller is correct 2. caller has enough balance to cover transaction fee(gaslimit * gasprice) 3. the amount of gas required is available in the block 4. the purchased gas is enough to cover intrinsic usage 5. there is no overflow when calculating intrinsic gas 6. caller has enough balance to cover asset transfer for **topmost** call
The preprocessing steps performed by the AnteHandler are:
1. set up the initial access list (iff fork > Berlin)
Tracer parameter ¶
It should be a `vm.Tracer` object or nil, if pass `nil`, it'll create a default one based on keeper options.
Commit parameter ¶
If commit is true, the cache context stack will be committed, otherwise discarded.
func (*Keeper) ApplyTransaction ¶
func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumTxResponse, error)
ApplyTransaction runs and attempts to perform a state transition with the given transaction (i.e Message), that will only be persisted (committed) to the underlying KVStore if the transaction does not fail.
Gas tracking ¶
Ethereum consumes gas according to the EVM opcodes instead of general reads and writes to store. Because of this, the state transition needs to ignore the SDK gas consumption mechanism defined by the GasKVStore and instead consume the amount of gas used by the VM execution. The amount of gas used is tracked by the EVM and returned in the execution result.
Prior to the execution, the starting tx gas meter is saved and replaced with an infinite gas meter in a new context in order to ignore the SDK gas consumption config values (read, write, has, delete). After the execution, the gas used from the message execution will be added to the starting gas consumed, taking into consideration the amount of gas returned. Finally, the context is updated with the EVM gas consumed value prior to returning.
For relevant discussion see: https://github.com/cosmos/cosmos-sdk/discussions/9072
func (Keeper) Balance ¶
func (k Keeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error)
Balance implements the Query/Balance gRPC method
func (*Keeper) BeginBlock ¶
func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock sets the sdk Context and EIP155 chain id to the Keeper.
func (*Keeper) CachedContextsEmpty ¶
CachedContextsEmpty returns true if there's no cache contexts.
func (*Keeper) ClearAccessList ¶
func (k *Keeper) ClearAccessList()
ClearAccessList clear current access list
func (Keeper) ClearBalance ¶
ClearBalance subtracts the EVM all the balance denomination from the address balance while also updating the total supply.
func (*Keeper) ClearStateError ¶
func (k *Keeper) ClearStateError()
ClearStateError reset the previous state operation error to nil
func (Keeper) Code ¶
func (k Keeper) Code(c context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error)
Code implements the Query/Code gRPC method
func (*Keeper) CommitCachedContexts ¶
func (k *Keeper) CommitCachedContexts()
CommitCachedContexts commit all the cache contexts created by `StateDB.Snapshot`.
func (Keeper) CosmosAccount ¶
func (k Keeper) CosmosAccount(c context.Context, req *types.QueryCosmosAccountRequest) (*types.QueryCosmosAccountResponse, error)
func (*Keeper) CreateAccount ¶
CreateAccount creates a new EthAccount instance from the provided address and sets the value to store. If an account with the given address already exists, this function also resets any preexisting code and storage associated with that address.
func (Keeper) DeductTxCostsFromUserBalance ¶
func (k Keeper) DeductTxCostsFromUserBalance( ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, denom string, homestead, istanbul, london bool, ) (sdk.Coins, error)
DeductTxCostsFromUserBalance it calculates the tx costs and deducts the fees
func (Keeper) DeleteAccountStorage ¶
DeleteAccountStorage clears all the storage state associated with the given address.
func (Keeper) DeleteCode ¶
DeleteCode removes the contract code byte array from the store associated with the given address.
func (Keeper) EmitBlockBloomEvent ¶
EmitBlockBloomEvent emit block bloom events
func (*Keeper) Empty ¶
Empty returns true if the address meets the following conditions:
- nonce is 0
- balance amount for evm denom is 0
- account code hash is empty
Non-ethereum accounts are considered not empty
func (*Keeper) EndBlock ¶
func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock)
EndBlock also retrieves the bloom filter value from the transient store and commits it to the KVStore. The EVM end block logic doesn't update the validator set, thus it returns an empty slice.
func (Keeper) EstimateGas ¶
func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*types.EstimateGasResponse, error)
EstimateGas implements eth_estimateGas rpc api.
func (Keeper) EthCall ¶
func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.MsgEthereumTxResponse, error)
EthCall implements eth_call rpc api.
func (*Keeper) EthereumTx ¶
func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error)
EthereumTx implements the gRPC MsgServer interface. It receives a transaction which is then executed (i.e applied) against the go-ethereum EVM. The provided SDK Context is set to the Keeper so that it can implements and call the StateDB methods without receiving it as a function parameter.
func (*Keeper) Exist ¶
Exist returns true if the given account exists in store or if it has been marked as suicided in the transient store.
func (*Keeper) ForEachStorage ¶
ForEachStorage uses the store iterator to iterate over all the state keys and perform a callback function on each of them. The callback should return `true` to continue, return `false` to break early.
func (*Keeper) GasToRefund ¶
GasToRefund calculates the amount of gas the state machine should refund to the sender. It is capped by the refund quotient value. Note: do not pass 0 to refundQuotient
func (Keeper) GetAccountStorage ¶
GetAccountStorage return state storage associated with an account
func (Keeper) GetAddressCodeHash ¶
func (*Keeper) GetBalance ¶
GetBalance returns the EVM denomination balance of the provided address. The denomination is obtained from the module parameters.
func (Keeper) GetBlockBloomTransient ¶
GetBlockBloomTransient returns bloom bytes for the current block height
func (*Keeper) GetCode ¶
GetCode returns the code byte array associated with the given address. If the code hash from the account is empty, this function returns nil.
func (*Keeper) GetCodeHash ¶
GetCodeHash fetches the account from the store and returns its code hash. If the account doesn't exist or is not an EthAccount type, GetCodeHash returns the empty code hash value.
func (*Keeper) GetCodeSize ¶
GetCodeSize returns the size of the contract code associated with this object, or zero if none.
func (Keeper) GetCoinbaseAddress ¶
GetCoinbaseAddress returns the block proposer's validator operator address.
func (*Keeper) GetCommittedState ¶
GetCommittedState returns the value set in store for the given key hash. If the key is not registered this function returns the empty hash.
func (*Keeper) GetEthIntrinsicGas ¶
func (k *Keeper) GetEthIntrinsicGas(msg core.Message, cfg *params.ChainConfig, isContractCreation bool) (uint64, error)
GetEthIntrinsicGas returns the intrinsic gas cost for the transaction
func (Keeper) GetHashFn ¶
func (k Keeper) GetHashFn() vm.GetHashFunc
GetHashFn implements vm.GetHashFunc for Ethermint. It handles 3 cases:
- The requested height matches the current height from context (and thus same epoch number)
- The requested height is from an previous height from the same chain epoch
- The requested height is from a height greater than the latest one
func (Keeper) GetLogSizeTransient ¶
GetLogSizeTransient returns EVM log index on the current block.
func (*Keeper) GetNonce ¶
GetNonce retrieves the account with the given address and returns the tx sequence (i.e nonce). The function performs a no-op if the account is not found.
func (*Keeper) GetRefund ¶
GetRefund returns the amount of gas available for return after the tx execution finalizes. This value is reset to 0 on every transaction.
func (*Keeper) GetState ¶
GetState returns the committed state for the given key hash, as all changes are committed directly to the KVStore.
func (Keeper) GetTxHashTransient ¶
GetTxHashTransient returns the hash of current processing transaction
func (Keeper) GetTxIndexTransient ¶
GetTxIndexTransient returns EVM transaction index on the current block.
func (Keeper) GetTxLogsTransient ¶
GetTxLogsTransient returns the current logs for a given transaction hash from the KVStore. This function returns an empty, non-nil slice if no logs are found.
func (Keeper) HandleInitEvmParamsProposal ¶
func (*Keeper) HasStateError ¶
HasStateError return the previous error for any state operations
func (*Keeper) HasSuicided ¶
HasSuicided queries the transient store to check if the account has been marked as suicided in the current block. Accounts that are suicided will be returned as non-nil during queries and "cleared" after the block has been committed.
func (Keeper) IncreaseLogSizeTransient ¶
func (k Keeper) IncreaseLogSizeTransient()
IncreaseLogSizeTransient fetches the current EVM log index from the transient store, increases its value by one and then sets the new index back to the transient store.
func (Keeper) IncreaseTxIndexTransient ¶
func (k Keeper) IncreaseTxIndexTransient()
IncreaseTxIndexTransient fetches the current EVM tx index from the transient store, increases its value by one and then sets the new index back to the transient store.
func (Keeper) ModuleEnable ¶
func (k Keeper) ModuleEnable(c context.Context, _ *types.QueryModuleEnableRequest) (*types.QueryModuleEnableResponse, error)
func (*Keeper) NewEVM ¶
NewEVM generates a go-ethereum VM from the provided Message fields and the chain parameters (ChainConfig and module Params). It additionally sets the validator operator address as the coinbase address to make it available for the COINBASE opcode, even though there is no beneficiary of the coinbase transaction (since we're not mining).
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements the Query/Params gRPC method
func (*Keeper) PostTxProcessing ¶
PostTxProcessing delegate the call to the hooks. If no hook has been registered, this function returns with a `nil` error
func (*Keeper) PrepareAccessList ¶
func (k *Keeper) PrepareAccessList(sender common.Address, dest *common.Address, precompiles []common.Address, txAccesses ethtypes.AccessList)
PrepareAccessList handles the preparatory steps for executing a state transition with regards to both EIP-2929 and EIP-2930:
- Add sender to access list (2929)
- Add destination to access list (2929)
- Add precompiles to access list (2929)
- Add the contents of the optional tx access list (2930)
This method should only be called if Yolov3/Berlin/2929+2930 is applicable at the current number.
func (*Keeper) RefundGas ¶
RefundGas transfers the leftover gas to the sender of the message, caped to half of the total gas consumed in the transaction. Additionally, the function sets the total gas consumed to the value returned by the EVM execution, thus ignoring the previous intrinsic gas consumed during in the AnteHandler.
func (Keeper) ResetAccount ¶
ResetAccount removes the code, storage state, but keep all the native tokens stored with the given address.
func (*Keeper) ResetGasMeterAndConsumeGas ¶
ResetGasMeterAndConsumeGas reset first the gas meter consumed value to zero and set it back to the new value 'gasUsed'
func (Keeper) ResetRefundTransient ¶
ResetRefundTransient resets the available refund amount to 0
func (*Keeper) RevertToSnapshot ¶
RevertToSnapshot pop all the cached contexts after(including) the snapshot
func (Keeper) SetAddressCode ¶
func (Keeper) SetBlockBloomTransient ¶
SetBlockBloomTransient sets the given bloom bytes to the transient store. This value is reset on every block.
func (*Keeper) SetCode ¶
SetCode stores the code byte array to the application KVStore and sets the code hash to the given account. The code is deleted from the store if it is empty.
func (*Keeper) SetNonce ¶
SetNonce sets the given nonce as the sequence of the address' account. If the account doesn't exist, a new one will be created from the address.
func (*Keeper) SetState ¶
SetState sets the given hashes (key, value) to the KVStore. If the value hash is empty, this function deletes the key from the store.
func (Keeper) SetTxHashTransient ¶
SetTxHashTransient set the hash of processing transaction
func (Keeper) SetTxIndexTransient ¶
SetTxIndexTransient set the index of processing transaction
func (*Keeper) SlotInAccessList ¶
SlotInAccessList checks if the address and the slots are registered in the transient store
func (Keeper) Storage ¶
func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*types.QueryStorageResponse, error)
Storage implements the Query/Storage gRPC method
func (*Keeper) SubBalance ¶
SubBalance subtracts the given amount from the address balance by transferring the coins to an escrow account and then burning them. The coin denomination is obtained from the module parameters. This function performs a no-op if the amount is negative or the user doesn't have enough funds for the transfer.
func (*Keeper) SubRefund ¶
SubRefund subtracts the given amount of gas from the transient refund value. This function will panic if gas amount is greater than the stored refund.
func (*Keeper) Suicide ¶
Suicide marks the given account as suicided and clears the account balance of the EVM tokens.
func (Keeper) TraceBlock ¶
func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) (*types.QueryTraceBlockResponse, error)
TraceBlock configures a new tracer according to the provided configuration, and executes the given message in the provided environment for all the transactions in the queried block. The return value will be tracer dependent.
func (Keeper) TraceTx ¶
func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*types.QueryTraceTxResponse, error)
TraceTx configures a new tracer according to the provided configuration, and executes the given message in the provided environment. The return value will be tracer dependent.
func (Keeper) VMConfig ¶
VMConfig creates an EVM configuration from the debug setting and the extra EIPs enabled on the module parameters. The config generated uses the default JumpTable from the EVM.
func (Keeper) ValidatorAccount ¶
func (k Keeper) ValidatorAccount(c context.Context, req *types.QueryValidatorAccountRequest) (*types.QueryValidatorAccountResponse, error)
func (*Keeper) WithChainID ¶
WithChainID sets the chain id to the local variable in the keeper
func (*Keeper) WithContext ¶
WithContext clears the context stack, and set the initial context.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
type MultiEvmHooks ¶
MultiEvmHooks combine multiple evm hooks, all hook functions are run in array sequence
func NewMultiEvmHooks ¶
func NewMultiEvmHooks(hooks ...types.EvmHooks) MultiEvmHooks
NewMultiEvmHooks combine multiple evm hooks
func (MultiEvmHooks) PostTxProcessing ¶
func (mh MultiEvmHooks) PostTxProcessing(ctx sdk.Context, txHash common.Hash, logs []*ethtypes.Log) error
PostTxProcessing delegate the call to underlying hooks