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 BatchesLen int
34 BidValue *big.Int
35 BootCoord bool
36 // Bidder, Forer and URL correspond to the winner of the slot (which is
37 // not always the highest bidder). These are the values of the
38 // coordinator that is able to forge exclusively before the deadline.
39 Bidder ethCommon.Address
40 Forger ethCommon.Address
41 URL string
42}