evm: code comments and cleanup (#404)

* evm: code comments and cleanup

* context comment

* abci, tx type event and metrics

* statedb comments
This commit is contained in:
Federico Kunze Küllmer
2021-08-05 16:24:06 +00:00
committed by GitHub
parent ff855eaf6b
commit 098da6d0cc
7 changed files with 83 additions and 61 deletions
+1
View File
@@ -8,6 +8,7 @@ const (
AttributeKeyRecipient = "recipient"
AttributeKeyTxHash = "txHash"
AttributeKeyEthereumTxHash = "ethereumTxHash"
AttributeKeyTxType = "txType"
// tx failed in eth vm execution
AttributeKeyEthereumTxFailed = "ethereumTxFailed"
AttributeValueCategory = ModuleName
-17
View File
@@ -30,9 +30,6 @@ const (
prefixLogs
prefixCode
prefixStorage
prefixChainConfig
prefixHashTxReceipt
prefixBlockHeightTxs
)
const (
@@ -53,9 +50,6 @@ var (
KeyPrefixLogs = []byte{prefixLogs}
KeyPrefixCode = []byte{prefixCode}
KeyPrefixStorage = []byte{prefixStorage}
KeyPrefixChainConfig = []byte{prefixChainConfig}
KeyPrefixHashTxReceipt = []byte{prefixHashTxReceipt}
KeyPrefixBlockHeightTxs = []byte{prefixBlockHeightTxs}
)
var (
@@ -85,17 +79,6 @@ func StateKey(address ethcmn.Address, key []byte) []byte {
return append(AddressStoragePrefix(address), key...)
}
// KeyHashTxReceipt returns a key for accessing tx receipt data by hash.
func KeyHashTxReceipt(hash ethcmn.Hash) []byte {
return append(KeyPrefixHashTxReceipt, hash.Bytes()...)
}
// KeyBlockHeightTxs returns a key for accessing tx hash list by block height.
func KeyBlockHeightTxs(height uint64) []byte {
heightBytes := sdk.Uint64ToBigEndian(height)
return append(KeyPrefixBlockHeightTxs, heightBytes...)
}
// KeyAddressStorage returns the key hash to access a given account state. The composite key
// (address + hash) is hashed using Keccak256.
func KeyAddressStorage(address ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash {