Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderVersion1 = 1 HeaderSize = 73 // XXX rename KeystoneHeaderPeriod = 25 // XXX debate and set OldHeaderSize = 65 HEMIBase = 1000000000000000000 )
View Source
const ( L2KeystoneAbrevVersion uint8 = 1 L2KeystoneAbrevSize = 76 )
L2KeystoneVersion designates hwta version of the L2 keystone we are using.
Variables ¶
This section is empty.
Functions ¶
func HashSerializedL2KeystoneAbrevB ¶ added in v0.11.2
Types ¶
type Header ¶
type Header struct {
Version uint8 // 0:1
BlockNumber uint32 // 1:5
ParentEPHash [12]byte // 5:17
PrevKeystoneEPHash [12]byte // 17:29
StateRoot [32]byte // 29:61
EPHash [12]byte // 61:73
}
XXX Header should be renamed to L2KeystoneAbrev
func NewHeaderFromBytes ¶
type L2BTCFinality ¶
type L2BTCFinality struct {
L2Keystone L2Keystone `json:"l2_keystone"`
BTCPubHeight int64 `json:"btc_pub_height"`
BTCPubHeaderHash api.ByteSlice `json:"btc_pub_header_hash"`
BTCFinality int32 `json:"btc_finality"`
}
func L2BTCFinalityFromBfgd ¶
func L2BTCFinalityFromBfgd(l2BtcFinality *bfgd.L2BTCFinality, currentBTCHeight uint32, effectiveHeight uint32) (*L2BTCFinality, error)
type L2Keystone ¶
type L2Keystone struct {
Version uint8 `json:"version"`
L1BlockNumber uint32 `json:"l1_block_number"`
L2BlockNumber uint32 `json:"l2_block_number"`
ParentEPHash api.ByteSlice `json:"parent_ep_hash"`
PrevKeystoneEPHash api.ByteSlice `json:"prev_ep_keystone_hash"`
StateRoot api.ByteSlice `json:"state_root"`
EPHash api.ByteSlice `json:"ep_hash"`
}
L2Keystone is the wire format of a keystone that is shared among several daemons.
type L2KeystoneAbrev ¶
type L2KeystoneAbrev struct {
Version uint8 // [0:1]
L1BlockNumber uint32 // [1:5]
L2BlockNumber uint32 // [5:9]
ParentEPHash [11]byte // [9:20]
PrevKeystoneEPHash [12]byte // [20:32]
StateRoot [32]byte // [32:64]
EPHash [12]byte // [64:76]
}
L2KeystoneAbrev is the abbreviated format of an L2Keystone. It simply clips various hashes to a shorter version.
func L2KeystoneAbbreviate ¶
func L2KeystoneAbbreviate(l2ks L2Keystone) *L2KeystoneAbrev
func L2KeystoneAbrevDeserialize ¶
func L2KeystoneAbrevDeserialize(r RawAbbreviatedL2Keystone) *L2KeystoneAbrev
func NewL2KeystoneAbrevFromBytes ¶
func NewL2KeystoneAbrevFromBytes(b []byte) (*L2KeystoneAbrev, error)
func (*L2KeystoneAbrev) Dump ¶
func (a *L2KeystoneAbrev) Dump(w io.Writer)
func (*L2KeystoneAbrev) Hash ¶
func (a *L2KeystoneAbrev) Hash() *chainhash.Hash
func (*L2KeystoneAbrev) HashB ¶ added in v0.11.2
func (a *L2KeystoneAbrev) HashB() []byte
func (*L2KeystoneAbrev) Serialize ¶
func (a *L2KeystoneAbrev) Serialize() RawAbbreviatedL2Keystone
type RawAbbreviatedL2Keystone ¶ added in v0.11.5
type RawAbbreviatedL2Keystone [L2KeystoneAbrevSize]byte
type RawHeader ¶
type RawHeader [HeaderSize]byte
Click to show internal directories.
Click to hide internal directories.