forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
70 lines (66 loc) · 2.27 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package state
import (
"github.com/0xPolygonHermez/zkevm-node/state/runtime/instrumentation"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
// ProcessBatchRequest represents a request to process a batch.
type ProcessBatchRequest struct {
BatchNum uint64
Coinbase common.Address
BatchL2Data []byte
OldStateRoot common.Hash
GlobalExitRoot common.Hash
OldLocalExitRoot common.Hash
EthTimestamp uint64
UpdateMerkleTree bool
GenerateExecuteTrace bool
GenerateCallTrace bool
}
// ProcessBatchResponse represents the response of a batch process.
type ProcessBatchResponse struct {
CumulativeGasUsed uint64
IsBatchProcessed bool
Responses []*ProcessTransactionResponse
NewStateRoot common.Hash
NewLocalExitRoot common.Hash
CntKeccakHashes uint32
CntPoseidonHashes uint32
CntPoseidonPaddings uint32
CntMemAligns uint32
CntArithmetics uint32
CntBinaries uint32
CntSteps uint32
}
// ProcessTransactionResponse represents the response of a tx process.
type ProcessTransactionResponse struct {
// TxHash is the hash of the transaction
TxHash common.Hash
// Type indicates legacy transaction
// It will be always 0 (legacy) in the executor
Type uint32
// ReturnValue is the returned data from the runtime (function result or data supplied with revert opcode)
ReturnValue []byte
// GasLeft is the total gas left as result of execution
GasLeft uint64
// GasUsed is the total gas used as result of execution or gas estimation
GasUsed uint64
// GasRefunded is the total gas refunded as result of execution
GasRefunded uint64
// Error represents any error encountered during the execution
Error error
// CreateAddress is the new SC Address in case of SC creation
CreateAddress common.Address
// StateRoot is the State Root
StateRoot common.Hash
// Logs emitted by LOG opcode
Logs []*types.Log
// IsProcessed indicates if this tx didn't fit into the batch
IsProcessed bool
// Tx is the whole transaction object
Tx types.Transaction
// ExecutionTrace contains the traces produced in the execution
ExecutionTrace []instrumentation.StructLog
// CallTrace contains the call trace.
CallTrace instrumentation.ExecutorTrace
}