You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

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