Documentation ¶
Index ¶
- Constants
- type BridgeWatcher
- type GuardianSet
- type GuardianSetState
- func (st *GuardianSetState) Get() *GuardianSet
- func (st *GuardianSetState) GetAll() map[common.Address]map[peer.ID]*gossipv1.Heartbeat
- func (st *GuardianSetState) LastHeartbeat(addr common.Address) map[peer.ID]*gossipv1.Heartbeat
- func (st *GuardianSetState) Set(set *GuardianSet)
- func (st *GuardianSetState) SetHeartbeat(addr common.Address, peerId peer.ID, hb *gossipv1.Heartbeat) error
- type MessagePublication
Constants ¶
const ( ReadinessEthSyncing readiness.Component = "ethSyncing" ReadinessSolanaSyncing readiness.Component = "solanaSyncing" ReadinessTerraSyncing readiness.Component = "terraSyncing" ReadinessBSCSyncing readiness.Component = "bscSyncing" )
const MaxGuardianCount = 19
MaxGuardianCount specifies the maximum number of guardians supported by on-chain contracts.
Matching constants:
- MAX_LEN_GUARDIAN_KEYS in Solana contract (limited by transaction size - 19 is the maximum amount possible)
The Eth and Terra contracts do not specify a maximum number and support more than that, but presumably, chain-specific transaction size limits will apply at some point (untested).
const MaxNodesPerGuardian = 15
MaxNodesPerGuardian specifies the maximum amount of nodes per guardian key that we'll accept whenever we maintain any per-guardian, per-node state.
There currently isn't any state clean up, so the value is on the high side to prevent accidentally reaching the limit due to operational mistakes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeWatcher ¶
type BridgeWatcher interface {
WatchMessages(events chan *MessagePublication) error
}
type GuardianSet ¶
type GuardianSet struct { // Guardian's public key hashes truncated by the ETH standard hashing mechanism (20 bytes). Keys []common.Address // On-chain set index Index uint32 }
func (*GuardianSet) KeyIndex ¶
func (g *GuardianSet) KeyIndex(addr common.Address) (int, bool)
KeyIndex returns a given address index from the guardian set. Returns (-1, false) if the address wasn't found and (addr, true) otherwise.
func (*GuardianSet) KeysAsHexStrings ¶
func (g *GuardianSet) KeysAsHexStrings() []string
type GuardianSetState ¶
type GuardianSetState struct {
// contains filtered or unexported fields
}
func NewGuardianSetState ¶
func NewGuardianSetState() *GuardianSetState
func (*GuardianSetState) Get ¶
func (st *GuardianSetState) Get() *GuardianSet
func (*GuardianSetState) LastHeartbeat ¶
LastHeartbeat returns the most recent heartbeat message received for a given guardian node, or nil if none have been received.
func (*GuardianSetState) Set ¶
func (st *GuardianSetState) Set(set *GuardianSet)
func (*GuardianSetState) SetHeartbeat ¶
func (st *GuardianSetState) SetHeartbeat(addr common.Address, peerId peer.ID, hb *gossipv1.Heartbeat) error
SetHeartbeat stores a verified heartbeat observed by a given guardian.