Documentation
¶
Index ¶
- Variables
- func HexEncodeBig(bigint *big.Int) string
- func IsHexValid(s string) bool
- func Sign(privateKey *ecdsa.PrivateKey, hashToSign []byte) ([]byte, error)
- type ArgBig
- type ArgBytes
- type ArgHash
- type ArgUint64
- type Batch
- type BatchKey
- type DACStatus
- type OffChainData
- type Sequence
- type SequenceBanana
- type SignedSequence
- type SignedSequenceBanana
- func (s *SignedSequenceBanana) GetSignature() []byte
- func (s *SignedSequenceBanana) OffChainData() []OffChainData
- func (s *SignedSequenceBanana) SetSignature(sign []byte)
- func (s *SignedSequenceBanana) Sign(privateKey *ecdsa.PrivateKey) (ArgBytes, error)
- func (s *SignedSequenceBanana) Signer() (common.Address, error)
- type SignedSequenceInterface
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNonCanonicalSignature is returned when the signature is not canonical. ErrNonCanonicalSignature = errors.New("received non-canonical signature") )
Functions ¶
func HexEncodeBig ¶ added in v0.0.4
HexEncodeBig encodes bigint as a hex string with 0x prefix. The sign of the integer is ignored.
func IsHexValid ¶ added in v0.0.4
IsHexValid checks if the provided string is a valid hexadecimal value
Types ¶
type ArgBig ¶ added in v0.0.4
ArgBig helps to marshal big number values provided in the RPC requests
func (ArgBig) MarshalText ¶ added in v0.0.4
MarshalText marshals an array of bytes into an instance of ArgBig
func (*ArgBig) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals an instance of ArgBig into an array of bytes
type ArgBytes ¶ added in v0.0.4
type ArgBytes []byte
ArgBytes helps to marshal byte array values provided in the RPC requests
func ArgBytesPtr ¶ added in v0.0.4
ArgBytesPtr helps to marshal byte array values provided in the RPC requests
func (ArgBytes) MarshalText ¶ added in v0.0.4
MarshalText marshals into text
func (*ArgBytes) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals from text
type ArgHash ¶ added in v0.0.4
ArgHash represents a common.Hash that accepts strings shorter than 64 bytes, like 0x00
func (*ArgHash) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals from text
type ArgUint64 ¶ added in v0.0.4
type ArgUint64 uint64
ArgUint64 helps to marshal uint64 values provided in the RPC requests
func (ArgUint64) MarshalText ¶ added in v0.0.4
MarshalText marshals into text
func (*ArgUint64) UnmarshalText ¶ added in v0.0.4
UnmarshalText unmarshals from text
type Batch ¶
type Batch struct { L2Data ArgBytes `json:"L2Data"` ForcedGER common.Hash `json:"forcedGlobalExitRoot"` ForcedTimestamp ArgUint64 `json:"forcedTimestamp"` Coinbase common.Address `json:"coinbase"` ForcedBlockHashL1 common.Hash `json:"forcedBlockHashL1"` }
Batch represents the batch data that the sequencer will send to L1
type DACStatus ¶ added in v0.0.8
type DACStatus struct { Uptime string `json:"uptime"` Version string `json:"version"` KeyCount uint64 `json:"key_count"` BackfillProgress uint64 `json:"backfill_progress"` OffchainDataGapsExist bool `json:"offchain_data_gaps_exist"` }
DACStatus contains DAC status info
type OffChainData ¶
OffChainData represents some data that is not stored on chain and should be preserved
func RemoveDuplicateOffChainData ¶ added in v0.0.9
func RemoveDuplicateOffChainData(ods []OffChainData) []OffChainData
RemoveDuplicateOffChainData removes duplicate off chain data
type Sequence ¶
type Sequence []ArgBytes
Sequence represents the data that the sequencer will send to L1 and other metadata needed to build the accumulated input hash aka accInputHash
func (*Sequence) HashToSign ¶
HashToSign returns the accumulated input hash of the sequence. Note that this is equivalent to what happens on the smart contract
func (*Sequence) OffChainData ¶
func (s *Sequence) OffChainData() []OffChainData
OffChainData returns the data that needs to be stored off chain from a given sequence
type SequenceBanana ¶ added in v0.0.8
type SequenceBanana struct { Batches []Batch `json:"batches"` OldAccInputHash common.Hash `json:"oldAccInputhash"` L1InfoRoot common.Hash `json:"l1InfoRoot"` MaxSequenceTimestamp ArgUint64 `json:"maxSequenceTimestamp"` }
SequenceBanana represents the data that the sequencer will send to L1 and other metadata needed to build the accumulated input hash aka accInputHash
func (*SequenceBanana) HashToSign ¶ added in v0.0.8
func (s *SequenceBanana) HashToSign() []byte
HashToSign returns the accumulated input hash of the sequence. Note that this is equivalent to what happens on the smart contract
func (*SequenceBanana) OffChainData ¶ added in v0.0.8
func (s *SequenceBanana) OffChainData() []OffChainData
OffChainData returns the data that needs to be stored off chain from a given sequence
func (*SequenceBanana) Sign ¶ added in v0.0.8
func (s *SequenceBanana) Sign(privateKey *ecdsa.PrivateKey) ([]byte, error)
Sign returns a signed sequence by the private key. Note that what's being signed is the accumulated input hash
type SignedSequence ¶
type SignedSequence struct { Sequence Sequence `json:"sequence"` Signature ArgBytes `json:"signature"` }
SignedSequence is a sequence but signed
func (*SignedSequence) GetSignature ¶ added in v0.0.8
func (s *SignedSequence) GetSignature() []byte
GetSignature returns signature
func (*SignedSequence) OffChainData ¶ added in v0.0.8
func (s *SignedSequence) OffChainData() []OffChainData
OffChainData returns the data to be stored of the sequence
func (*SignedSequence) SetSignature ¶ added in v0.0.8
func (s *SignedSequence) SetSignature(sign []byte)
SetSignature set signature
func (*SignedSequence) Sign ¶ added in v0.0.8
func (s *SignedSequence) Sign(privateKey *ecdsa.PrivateKey) (ArgBytes, error)
Sign signs the sequence using the privateKey
type SignedSequenceBanana ¶ added in v0.0.8
type SignedSequenceBanana struct { Sequence SequenceBanana `json:"sequence"` Signature ArgBytes `json:"signature"` }
SignedSequenceBanana is a sequence but signed
func (*SignedSequenceBanana) GetSignature ¶ added in v0.0.8
func (s *SignedSequenceBanana) GetSignature() []byte
GetSignature returns signature
func (*SignedSequenceBanana) OffChainData ¶ added in v0.0.8
func (s *SignedSequenceBanana) OffChainData() []OffChainData
OffChainData returns the data to be stored of the sequence
func (*SignedSequenceBanana) SetSignature ¶ added in v0.0.8
func (s *SignedSequenceBanana) SetSignature(sign []byte)
SetSignature set signature
func (*SignedSequenceBanana) Sign ¶ added in v0.0.8
func (s *SignedSequenceBanana) Sign(privateKey *ecdsa.PrivateKey) (ArgBytes, error)
Sign signs the sequence using the privateKey
type SignedSequenceInterface ¶ added in v0.0.8
type SignedSequenceInterface interface { Signer() (common.Address, error) OffChainData() []OffChainData Sign(privateKey *ecdsa.PrivateKey) (ArgBytes, error) SetSignature([]byte) GetSignature() []byte }
SignedSequenceInterface is the interface that defines the methods that a signed sequence must implement