hermez-node/common/bid.go
common/bid.goRaw
1package common
2
3import (
4 "math/big"
5
6 ethCommon "github.com/ethereum/go-ethereum/common"
7)
8
9// Bid is a struct that represents one bid in the PoH
10type Bid struct {
11 SlotNum int64 `meddler:"slot_num"`
12 BidValue *big.Int `meddler:"bid_value,bigint"`
13 EthBlockNum int64 `meddler:"eth_block_num"`
14 Bidder ethCommon.Address `meddler:"bidder_addr"` // Coordinator reference
15}
16
17// BidCoordinator contains the coordinator info of a bid, along with the bid value
18type BidCoordinator struct {
19 SlotNum int64 `meddler:"slot_num"`
20 DefaultSlotSetBid [6]*big.Int `meddler:"default_slot_set_bid,json"`
21 BidValue *big.Int `meddler:"bid_value,bigint"`
22 Bidder ethCommon.Address `meddler:"bidder_addr"` // address of the bidder
23 Forger ethCommon.Address `meddler:"forger_addr"` // address of the forger
24 URL string `meddler:"url"` // URL of the coordinators API
25}
26
27// Slot contains relevant information of a slot
28type Slot struct {
29 SlotNum int64
30 DefaultSlotBid *big.Int
31 StartBlock int64
32 EndBlock int64
33 ForgerCommitment bool
34 // BatchesLen int
35 BidValue *big.Int
36 BootCoord bool
37 // Bidder, Forger and URL correspond to the winner of the slot (which is
38 // not always the highest bidder). These are the values of the
39 // coordinator that is able to forge exclusively before the deadline.
40 Bidder ethCommon.Address
41 Forger ethCommon.Address
42 URL string
43}