arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/common/batch.go
common/batch.goRaw
 1package common
 2
 3import (
 4	"math/big"
 5
 6	ethCommon "github.com/ethereum/go-ethereum/common"
 7)
 8
 9// Batch is a struct that represents Hermez network batch
10type Batch struct {
11	BatchNum         BatchNum
12	SlotNum          SlotNum // Slot in which the batch is forged
13	EthTxHash        ethCommon.Hash
14	EthBlockNum      uint64 // Ethereum block in which the batch is forged
15	ExitRoot         Hash
16	OldStateRoot     Hash
17	NewStateRoot     Hash
18	OldNumAccounts   int
19	NewNumAccounts   int
20	ToForgeL1TxsNum  uint32         // optional, Only when the batch forges L1 txs. Identifier that corresponds to the group of L1 txs forged in the current batch.
21	ToForgeL1TxsHash ethCommon.Hash // optional, Only when the batch forges L1 txs. Frozen from pendingL1TxsHash (which are the group of L1UserTxs), to be forged in ToForgeL1TxsNum + 1.
22	ForgedL1TxsHash  ethCommon.Hash // optional, Only when the batch forges L1 txs. This will be the Hash of the group of L1 txs (L1UserTxs + L1CoordinatorTx) forged in the current batch.
23	CollectedFees    map[TokenID]*big.Int
24	ForgerAddr       ethCommon.Address // TODO: Should this be retrieved via slot reference?
25}
26
27// BatchNum identifies a batch
28type BatchNum uint32