Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrOutOfOrder happens when you try to add data to the DB, // but it does not actually fit onto the latest data (by being too old or new). ErrOutOfOrder = errors.New("data out of order") // ErrDataCorruption happens when the underlying DB has some I/O issue ErrDataCorruption = errors.New("data corruption") // ErrSkipped happens when we try to retrieve data that is not available (pruned) // It may also happen if we erroneously skip data, that was not considered a conflict, if the DB is corrupted. ErrSkipped = errors.New("skipped data") // ErrFuture happens when data is just not yet available ErrFuture = errors.New("future data") // ErrConflict happens when we know for sure that there is different canonical data ErrConflict = errors.New("conflicting data") // ErrStop can be used in iterators to indicate iteration has to stop ErrStop = errors.New("iter stop") // ErrOutOfScope is when data is accessed, but access is not allowed, because of a limited scope. // E.g. when limiting scope to L2 blocks derived from a specific subset of the L1 chain. ErrOutOfScope = errors.New("out of scope") // ErrPreviousToFirst is when you try to get the previous block of the first block // E.g. when calling PreviousDerivedFrom on the first L1 block in the DB. ErrPreviousToFirst = errors.New("cannot get parent of first block in the database") // ErrUnknownChain is when a chain is unknown, not in the dependency set. ErrUnknownChain = errors.New("unknown chain") // ErrNoRPCSource happens when a sub-service needs an RPC data source, but is not configured with one. ErrNoRPCSource = errors.New("no RPC client configured") )
Functions ¶
func LogToMessagePayload ¶ added in v1.9.5
LogToMessagePayload is the data that is hashed to get the payloadHash it is the concatenation of the log's topics and data the implementation is based on the interop messaging spec
func PayloadHashToLogHash ¶ added in v1.9.5
PayloadHashToLogHash converts the payload hash to the log hash it is the concatenation of the log's address and the hash of the log's payload, which is then hashed again. This is the hash that is stored in the log storage. The logHash can then be used to traverse from the executing message to the log the referenced initiating message.
Types ¶
type BlockSeal ¶ added in v1.9.5
func BlockSealFromRef ¶ added in v1.9.5
func (BlockSeal) ForceWithParent ¶ added in v1.9.5
func (BlockSeal) MustWithParent ¶ added in v1.9.5
type ChainID ¶
func ChainIDFromBig ¶
func ChainIDFromUInt64 ¶
func (ChainID) MarshalText ¶ added in v1.9.5
func (*ChainID) UnmarshalText ¶ added in v1.9.5
type ChainIndex ¶ added in v1.9.5
type ChainIndex uint32
ChainIndex represents the lifetime of a chain in a dependency set.
func (ChainIndex) MarshalText ¶ added in v1.9.5
func (ci ChainIndex) MarshalText() ([]byte, error)
func (ChainIndex) String ¶ added in v1.9.5
func (ci ChainIndex) String() string
func (*ChainIndex) UnmarshalText ¶ added in v1.9.5
func (ci *ChainIndex) UnmarshalText(data []byte) error
type ExecutingMessage ¶ added in v1.9.3
type ExecutingMessage struct { Chain ChainIndex // same as ChainID for now, but will be indirect, i.e. translated to full ID, later BlockNum uint64 LogIdx uint32 Timestamp uint64 Hash common.Hash }
func (*ExecutingMessage) String ¶ added in v1.9.5
func (s *ExecutingMessage) String() string
type Identifier ¶
type Identifier struct { Origin common.Address BlockNumber uint64 LogIndex uint32 Timestamp uint64 ChainID ChainID // flat, not a pointer, to make Identifier safe as map key }
func (Identifier) MarshalJSON ¶
func (id Identifier) MarshalJSON() ([]byte, error)
func (*Identifier) UnmarshalJSON ¶
func (id *Identifier) UnmarshalJSON(input []byte) error
type Message ¶ added in v1.9.1
type Message struct { Identifier Identifier `json:"identifier"` PayloadHash common.Hash `json:"payloadHash"` }
type ReferenceView ¶ added in v1.9.5
func (ReferenceView) String ¶ added in v1.9.5
func (v ReferenceView) String() string
type SafetyLevel ¶
type SafetyLevel string
const ( // Finalized is CrossSafe, with the additional constraint that every // dependency is derived only from finalized L1 input data. // This matches RPC label "finalized". Finalized SafetyLevel = "finalized" // CrossSafe is as safe as LocalSafe, with all its dependencies // also fully verified to be reproducible from L1. // This matches RPC label "safe". CrossSafe SafetyLevel = "safe" // LocalSafe is verified to be reproducible from L1, // without any verified cross-L2 dependencies. // This does not have an RPC label. LocalSafe SafetyLevel = "local-safe" // CrossUnsafe is as safe as LocalUnsafe, // but with verified cross-L2 dependencies that are at least CrossUnsafe. // This does not have an RPC label. CrossUnsafe SafetyLevel = "cross-unsafe" // LocalUnsafe is the safety of the tip of the chain. This matches RPC label "unsafe". LocalUnsafe SafetyLevel = "unsafe" // Invalid is the safety of when the message or block is not matching the expected data. Invalid SafetyLevel = "invalid" )
func (*SafetyLevel) AtLeastAsSafe ¶ added in v1.9.1
func (lvl *SafetyLevel) AtLeastAsSafe(min SafetyLevel) bool
AtLeastAsSafe returns true if the receiver is at least as safe as the other SafetyLevel. Safety levels are assumed to graduate from LocalUnsafe to LocalSafe to CrossUnsafe to CrossSafe, with Finalized as the strongest.
func (SafetyLevel) MarshalText ¶
func (lvl SafetyLevel) MarshalText() ([]byte, error)
func (SafetyLevel) String ¶
func (lvl SafetyLevel) String() string
func (*SafetyLevel) UnmarshalText ¶
func (lvl *SafetyLevel) UnmarshalText(text []byte) error
func (SafetyLevel) Valid ¶
func (lvl SafetyLevel) Valid() bool