Documentation ¶
Index ¶
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type BlockInnerData
- type GovKeeper
- type Keeper
- func (k *Keeper) AddContract(...interface{})
- func (k *Keeper) AddHeightHashToCache(height int64, hash string)
- func (k *Keeper) AddInnerTx(...interface{})
- func (k Keeper) AfterDepositPeriodPassed(_ sdk.Context, _ govTypes.Proposal)
- func (k Keeper) AfterSubmitProposalHandler(_ sdk.Context, _ govTypes.Proposal)
- func (k Keeper) BalanceInvariant() sdk.Invariant
- func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (k *Keeper) CallEvmHooks(ctx sdk.Context, st *types.StateTransition, receipt *ethtypes.Receipt) error
- func (k Keeper) CheckMsgSubmitProposal(ctx sdk.Context, msg govTypes.MsgSubmitProposal) sdk.Error
- func (k *Keeper) Commit(ctx sdk.Context)
- func (k *Keeper) DelSysContractAddress(ctx sdk.Context) sdk.Error
- func (k *Keeper) DeleteInnerTx(...interface{})
- func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
- func (k *Keeper) FixLog(tx []sdk.Tx, logIndex []int, hasEnterEvmTx []bool, anteErrs []error, ...) [][]byte
- func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
- func (k *Keeper) GenerateCSDBParams() types.CommitStateDBParams
- func (k Keeper) GeneratePureCSDBParams() types.CommitStateDBParams
- func (k Keeper) GetAccountStorage(ctx sdk.Context, address ethcmn.Address) (types.Storage, error)
- func (k *Keeper) GetBalance(ctx sdk.Context, addr ethcmn.Address) *big.Int
- func (k Keeper) GetBlockBloom(ctx sdk.Context, height int64) ethtypes.Bloom
- func (k *Keeper) GetBlockHash() ethcmn.Hash
- func (k Keeper) GetBlockHeight(ctx sdk.Context, hash ethcmn.Hash) (int64, bool)
- func (k *Keeper) GetCallToCM() vm.CallToWasmByPrecompile
- func (k Keeper) GetChainConfig(ctx sdk.Context) (types.ChainConfig, bool)
- func (k *Keeper) GetCode(ctx sdk.Context, addr ethcmn.Address) []byte
- func (k *Keeper) GetCodeByHash(ctx sdk.Context, hash ethcmn.Hash) []byte
- func (k Keeper) GetHeightHash(ctx sdk.Context, height uint64) ethcmn.Hash
- func (k *Keeper) GetHooks() types.EvmHooks
- func (k *Keeper) GetLatestStoredBlockHeight() uint64
- func (k Keeper) GetMaxDepositPeriod(ctx sdk.Context, content sdkGov.Content) (maxDepositPeriod time.Duration)
- func (k Keeper) GetMinDeposit(ctx sdk.Context, content sdkGov.Content) (minDeposit sdk.SysCoins)
- func (k *Keeper) GetMptRootHash(height uint64) ethcmn.Hash
- func (k *Keeper) GetOrNewStateObject(ctx sdk.Context, addr ethcmn.Address) types.StateObject
- func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) GetState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
- func (k *Keeper) GetStateByKey(ctx sdk.Context, addr ethcmn.Address, key ethcmn.Hash) ethcmn.Hash
- func (k Keeper) GetStoreKey() store.StoreKey
- func (k *Keeper) GetSysContractAddress(ctx sdk.Context) (sdk.AccAddress, sdk.Error)
- func (k Keeper) GetVotingPeriod(ctx sdk.Context, content sdkGov.Content) (votingPeriod time.Duration)
- func (k *Keeper) InitInnerBlock(...interface{})
- func (k *Keeper) IsAddressBlocked(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IsContractAccount(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k *Keeper) IsContractInBlockedList(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k *Keeper) IsMatchSysContractAddress(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IterateBlockBloom(ctx sdk.Context, fn func(key []byte, value []byte) (stop bool))
- func (k Keeper) IterateBlockHash(ctx sdk.Context, fn func(key []byte, value []byte) (stop bool))
- func (k Keeper) Logger() log.Logger
- func (k Keeper) NonceInvariant() sdk.Invariant
- func (k *Keeper) OnAccountUpdated(acc auth.Account)
- func (k *Keeper) OnStop(ctx sdk.Context) error
- func (k *Keeper) OpenTrie()
- func (k *Keeper) PushData2Database(height int64, log log.Logger)
- func (k Keeper) RejectedHandler(_ sdk.Context, _ govTypes.Content)
- func (k *Keeper) ResetHooks() *Keeper
- func (k *Keeper) SetBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k Keeper) SetBlockBloom(ctx sdk.Context, height int64, bloom ethtypes.Bloom)
- func (k Keeper) SetBlockHeight(ctx sdk.Context, hash []byte, height int64)
- func (k *Keeper) SetCallToCM(callToCM vm.CallToWasmByPrecompile)
- func (k *Keeper) SetChainConfig(ctx sdk.Context, config types.ChainConfig)
- func (k Keeper) SetCodeDirectly(ctx sdk.Context, hash, code []byte)
- func (k *Keeper) SetGovKeeper(gk GovKeeper)
- func (k Keeper) SetHeightHash(ctx sdk.Context, height uint64, hash ethcmn.Hash)
- func (k *Keeper) SetHooks(hooks types.EvmHooks) *Keeper
- func (k *Keeper) SetLatestStoredBlockHeight(height uint64)
- func (k *Keeper) SetMptRootHash(ctx sdk.Context, hash ethcmn.Hash)
- func (k *Keeper) SetNonce(ctx sdk.Context, addr ethcmn.Address, nonce uint64)
- func (k *Keeper) SetObserverKeeper(infuraKeeper watcher.InfuraKeeper)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetStateDirectly(ctx sdk.Context, addr ethcmn.Address, key, value ethcmn.Hash)
- func (k *Keeper) SetSysContractAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error
- func (k *Keeper) SetTargetMptVersion(targetVersion int64)
- func (k *Keeper) UpdateInnerBlockData(...interface{})
- func (k *Keeper) UpdateInnerTx(...interface{})
- func (k *Keeper) UpdateWasmInnerTx(...interface{})
- func (k Keeper) VoteHandler(_ sdk.Context, _ govTypes.Proposal, _ govTypes.Vote) (string, sdk.Error)
- type LogProcessEvmHook
- type LogsManager
- type MultiEvmHooks
- type TxResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the evm module invariants
Types ¶
type BlockInnerData ¶ added in v0.19.14
type BlockInnerData = interface{}
type GovKeeper ¶
type GovKeeper interface { GetDepositParams(ctx sdk.Context) govtypes.DepositParams GetVotingParams(ctx sdk.Context) govtypes.VotingParams }
GovKeeper defines the expected gov Keeper
type Keeper ¶
type Keeper struct { // Transaction counter in a block. Used on StateSB's Prepare function. // It is reset to 0 every block on BeginBlock so there's no point in storing the counter // on the KVStore or adding it as a field on the EVM genesis state. TxCount int Bloom *big.Int Bhash ethcmn.Hash LogSize uint Ada types.DbAdapter LogsManages *LogsManager EvmStateDb *types.CommitStateDB UpdatedAccount []ethcmn.Address Watcher *watcher.Watcher // contains filtered or unexported fields }
Keeper wraps the CommitStateDB, allowing us to pass in SDK context while adhering to the StateDB interface.
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspace, ak types.AccountKeeper, sk types.SupplyKeeper, bk types.BankKeeper, stk types.StakingKeeper, logger log.Logger) *Keeper
NewKeeper generates new evm module keeper
func NewSimulateKeeper ¶ added in v0.18.7
func NewSimulateKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace types.Subspace, ak types.AccountKeeper, sk types.SupplyKeeper, bk types.BankKeeper, stk types.StakingKeeper, ada types.DbAdapter, logger log.Logger) *Keeper
NewKeeper generates new evm module keeper
func (*Keeper) AddContract ¶ added in v0.19.14
func (k *Keeper) AddContract(...interface{})
AddContract add erc20 contract
func (*Keeper) AddHeightHashToCache ¶ added in v1.6.3
Add latest block height and hash to lru cache
func (*Keeper) AddInnerTx ¶ added in v0.19.14
func (k *Keeper) AddInnerTx(...interface{})
AddInnerTx add inner tx
func (Keeper) AfterDepositPeriodPassed ¶
func (Keeper) AfterSubmitProposalHandler ¶
nolint
func (Keeper) BalanceInvariant ¶
BalanceInvariant checks that all auth module's EthAccounts in the application have the same balance as the EVM one.
func (*Keeper) BeginBlock ¶
func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock sets the block hash -> block height map for the previous block height and resets the Bloom filter and the transaction count to 0.
func (*Keeper) CallEvmHooks ¶ added in v1.3.0
func (k *Keeper) CallEvmHooks(ctx sdk.Context, st *types.StateTransition, receipt *ethtypes.Receipt) error
CallEvmHooks delegate the call to the hooks. If no hook has been registered, this function returns with a `nil` error
func (Keeper) CheckMsgSubmitProposal ¶
CheckMsgSubmitProposal validates MsgSubmitProposal
func (*Keeper) DelSysContractAddress ¶ added in v1.6.6
DelSysContractAddress del system contract address to store
func (*Keeper) DeleteInnerTx ¶ added in v1.6.6
func (k *Keeper) DeleteInnerTx(...interface{})
DeleteInnerTx delete inner tx
func (*Keeper) EndBlock ¶
func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock updates the accounts and commits state objects to the KV Store, while deleting the empty ones. It also sets the bloom filers for the request block to the store. The EVM end block logic doesn't update the validator set, thus it returns an empty slice.
func (*Keeper) ForEachStorage ¶
func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
ForEachStorage calls CommitStateDB.ForEachStorage using passed in context
func (*Keeper) GenerateCSDBParams ¶
func (k *Keeper) GenerateCSDBParams() types.CommitStateDBParams
Logger returns a module-specific logger.
func (Keeper) GeneratePureCSDBParams ¶
func (k Keeper) GeneratePureCSDBParams() types.CommitStateDBParams
GeneratePureCSDBParams generates an instance of csdb params ONLY for store setter and getter
func (Keeper) GetAccountStorage ¶
GetAccountStorage return state storage associated with an account
func (*Keeper) GetBalance ¶
GetBalance calls CommitStateDB.GetBalance using the passed in context
func (Keeper) GetBlockBloom ¶
GetBlockBloom gets bloombits from block height
func (*Keeper) GetBlockHash ¶
func (Keeper) GetBlockHeight ¶ added in v1.6.3
GetBlockHeight gets block height from block consensus hash
func (*Keeper) GetCallToCM ¶ added in v1.7.4
func (k *Keeper) GetCallToCM() vm.CallToWasmByPrecompile
func (Keeper) GetChainConfig ¶
GetChainConfig gets chain config, the result if from cached result, or it gains chain config and gas costs from getChainConfig, then cache the chain config and gas costs.
func (*Keeper) GetCodeByHash ¶ added in v0.18.7
GetCodeByHash calls CommitStateDB.GetCode using the passed in context
func (Keeper) GetHeightHash ¶
GetHeightHash returns the block header hash associated with a given block height and chain epoch number.
func (*Keeper) GetLatestStoredBlockHeight ¶ added in v1.5.0
GetLatestStoredBlockHeight get latest stored mpt storage height
func (Keeper) GetMaxDepositPeriod ¶
func (k Keeper) GetMaxDepositPeriod(ctx sdk.Context, content sdkGov.Content) (maxDepositPeriod time.Duration)
GetMaxDepositPeriod returns max deposit period
func (Keeper) GetMinDeposit ¶
GetMinDeposit returns min deposit
func (*Keeper) GetMptRootHash ¶ added in v1.5.0
GetMptRootHash gets root mpt hash from block height
func (*Keeper) GetOrNewStateObject ¶
GetOrNewStateObject calls CommitStateDB.GetOrNetStateObject using the passed in context
func (*Keeper) GetStateByKey ¶ added in v0.18.7
GetStateByKey calls CommitStateDB.GetState using the passed in context
func (Keeper) GetStoreKey ¶ added in v0.18.7
func (*Keeper) GetSysContractAddress ¶ added in v1.6.6
func (Keeper) GetVotingPeriod ¶
func (k Keeper) GetVotingPeriod(ctx sdk.Context, content sdkGov.Content) (votingPeriod time.Duration)
GetVotingPeriod returns voting period
func (*Keeper) InitInnerBlock ¶ added in v0.19.14
func (k *Keeper) InitInnerBlock(...interface{})
InitInnerBlock init inner block data
func (*Keeper) IsAddressBlocked ¶ added in v0.19.11
checks whether the address is blocked
func (Keeper) IsContractAccount ¶ added in v1.6.6
func (*Keeper) IsContractInBlockedList ¶ added in v1.1.10
func (*Keeper) IsMatchSysContractAddress ¶ added in v1.6.6
func (Keeper) IterateBlockBloom ¶ added in v1.5.0
IterateBlockBloom iterates all over the bloom value in every height
func (Keeper) IterateBlockHash ¶ added in v1.5.0
IterateBlockHash iterates all over the block hash in every height
func (Keeper) NonceInvariant ¶
NonceInvariant checks that all auth module's EthAccounts in the application have the same nonce sequence as the EVM.
func (*Keeper) OnAccountUpdated ¶ added in v0.18.7
Warning, you need to use pointer object here, for you need to update UpdatedAccount var
func (*Keeper) OnStop ¶ added in v1.5.0
Stop stops the blockchain service. If any imports are currently in progress it will abort them using the procInterrupt.
func (*Keeper) PushData2Database ¶ added in v1.5.0
PushData2Database writes all associated state in cache to the database
func (*Keeper) ResetHooks ¶ added in v1.3.0
ResetHooks resets the hooks for the EVM module
func (*Keeper) SetBalance ¶
SetBalance calls CommitStateDB.SetBalance using the passed in context
func (Keeper) SetBlockBloom ¶
SetBlockBloom sets the mapping from block height to bloom bits
func (Keeper) SetBlockHeight ¶ added in v1.6.3
SetBlockHeight sets the mapping from block consensus hash to block height
func (*Keeper) SetCallToCM ¶ added in v1.7.4
func (k *Keeper) SetCallToCM(callToCM vm.CallToWasmByPrecompile)
func (*Keeper) SetChainConfig ¶
func (k *Keeper) SetChainConfig(ctx sdk.Context, config types.ChainConfig)
SetChainConfig sets the mapping from block consensus hash to block height
func (Keeper) SetCodeDirectly ¶
SetCodeDirectly commit code into db with no cache
func (*Keeper) SetGovKeeper ¶
SetGovKeeper sets keeper of gov
func (Keeper) SetHeightHash ¶
SetHeightHash sets the block header hash associated with a given height.
func (*Keeper) SetHooks ¶ added in v1.3.0
SetHooks sets the hooks for the EVM module It should be called only once during initialization, it panics if called more than once.
func (*Keeper) SetLatestStoredBlockHeight ¶ added in v1.5.0
SetLatestStoredBlockHeight sets the latest stored storage height
func (*Keeper) SetMptRootHash ¶ added in v1.5.0
SetMptRootHash sets the mapping from block height to root mpt hash
func (*Keeper) SetObserverKeeper ¶ added in v1.5.5
func (k *Keeper) SetObserverKeeper(infuraKeeper watcher.InfuraKeeper)
func (Keeper) SetStateDirectly ¶
SetStateDirectly commit one state into db with no cache
func (*Keeper) SetSysContractAddress ¶ added in v1.6.6
SetSysContractAddress set system contract address to store
func (*Keeper) SetTargetMptVersion ¶ added in v1.5.0
func (*Keeper) UpdateInnerBlockData ¶ added in v0.19.14
func (k *Keeper) UpdateInnerBlockData(...interface{})
func (*Keeper) UpdateInnerTx ¶ added in v1.0.3
func (k *Keeper) UpdateInnerTx(...interface{})
func (*Keeper) UpdateWasmInnerTx ¶ added in v1.6.7
func (k *Keeper) UpdateWasmInnerTx(...interface{})
type LogProcessEvmHook ¶ added in v1.3.0
type LogProcessEvmHook struct {
// contains filtered or unexported fields
}
LogProcessEvmHook is an evm hook that convert specific contract logs into native module calls
func NewLogProcessEvmHook ¶ added in v1.3.0
func NewLogProcessEvmHook(handlers ...types.EvmLogHandler) LogProcessEvmHook
func (LogProcessEvmHook) IsCanHooked ¶ added in v1.7.0
func (lh LogProcessEvmHook) IsCanHooked(logs []*ethtypes.Log) bool
func (LogProcessEvmHook) PostTxProcessing ¶ added in v1.3.0
func (lh LogProcessEvmHook) PostTxProcessing(ctx sdk.Context, st *types.StateTransition, receipt *ethtypes.Receipt) error
PostTxProcessing delegate the call to underlying hooks
type LogsManager ¶ added in v0.19.13
func NewLogManager ¶ added in v0.19.13
func NewLogManager() *LogsManager
func (*LogsManager) Len ¶ added in v0.19.13
func (l *LogsManager) Len() int
func (*LogsManager) Reset ¶ added in v0.19.13
func (l *LogsManager) Reset()
func (*LogsManager) Set ¶ added in v0.19.13
func (l *LogsManager) Set(value TxResult) int
type MultiEvmHooks ¶ added in v1.3.0
MultiEvmHooks combine multiple evm hooks, all hook functions are run in array sequence
func NewMultiEvmHooks ¶ added in v1.3.0
func NewMultiEvmHooks(hooks ...types.EvmHooks) MultiEvmHooks
NewMultiEvmHooks combine multiple evm hooks
func (MultiEvmHooks) PostTxProcessing ¶ added in v1.3.0
func (mh MultiEvmHooks) PostTxProcessing(ctx sdk.Context, st *types.StateTransition, receipt *ethtypes.Receipt) error
PostTxProcessing delegate the call to underlying hooks
type TxResult ¶ added in v0.19.13
type TxResult struct {
ResultData *types.ResultData
}