Documentation ¶
Index ¶
- func BisectionChunkHash(segmentStart *big.Int, segmentLength *big.Int, startHash common.Hash, ...) common.Hash
- func DeliverMessagesAndWait(db ArbCoreInbox, messages []inbox.InboxMessage, previousInboxAcc common.Hash, ...) (bool, error)
- func GetSingleMessage(lookup ArbOutputLookup, index *big.Int) (inbox.InboxMessage, error)
- func GetSingleSend(lookup ArbOutputLookup, index *big.Int) ([]byte, error)
- func GetZeroOrOneLog(lookup ArbOutputLookup, index *big.Int) (value.Value, error)
- func IsAssertionValid(assertion *Assertion, execTracker *ExecutionTracker, targetInboxAcc [32]byte) (bool, error)
- func ReorgAndWait(db ArbCoreInbox, reorgMessageCount *big.Int) error
- type ArbCore
- type ArbCoreInbox
- type ArbCoreLookup
- type ArbOutputLookup
- type Assertion
- func (a *Assertion) AfterExecutionHash() common.Hash
- func (a *Assertion) BeforeExecutionHash() common.Hash
- func (a *Assertion) BytesFields() [2][3][32]byte
- func (a *Assertion) CheckTime(arbGasSpeedLimitPerBlock *big.Int) *big.Int
- func (a *Assertion) ExecutionHash() common.Hash
- func (a *Assertion) IntFields() [2][4]*big.Int
- type BigIntList
- type Bisection
- type ChallengeKind
- type ChallengeSegment
- type Cut
- type ExecutionCursor
- type ExecutionState
- type ExecutionTracker
- type InMemoryOutputLookup
- func (as *InMemoryOutputLookup) GetLog(index uint64) (value.Value, error)
- func (as *InMemoryOutputLookup) GetLogCount() (*big.Int, error)
- func (as *InMemoryOutputLookup) GetLogs(startIndex, count *big.Int) ([]value.Value, error)
- func (as *InMemoryOutputLookup) GetMessage(index uint64) (value.Value, error)
- func (as *InMemoryOutputLookup) GetMessageCount() (*big.Int, error)
- func (as *InMemoryOutputLookup) GetMessages(startIndex, count *big.Int) ([]inbox.InboxMessage, error)
- func (as *InMemoryOutputLookup) GetSendCount() (*big.Int, error)
- func (as *InMemoryOutputLookup) GetSends(startIndex, count *big.Int) ([][]byte, error)
- func (as *InMemoryOutputLookup) LogCount() (uint64, error)
- func (as *InMemoryOutputLookup) MessageCount() (uint64, error)
- func (as *InMemoryOutputLookup) SaveLog(val value.Value) error
- type LogConsumer
- type LogReader
- type LogsCursor
- type MessageStatus
- type NodeID
- type NodeInfo
- type NodeState
- type SimpleCut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BisectionChunkHash ¶
func DeliverMessagesAndWait ¶
func DeliverMessagesAndWait(db ArbCoreInbox, messages []inbox.InboxMessage, previousInboxAcc common.Hash, lastBlockComplete bool) (bool, error)
func GetSingleMessage ¶
func GetSingleMessage(lookup ArbOutputLookup, index *big.Int) (inbox.InboxMessage, error)
func GetSingleSend ¶
func GetSingleSend(lookup ArbOutputLookup, index *big.Int) ([]byte, error)
func GetZeroOrOneLog ¶
func IsAssertionValid ¶
func IsAssertionValid(assertion *Assertion, execTracker *ExecutionTracker, targetInboxAcc [32]byte) (bool, error)
func ReorgAndWait ¶
func ReorgAndWait(db ArbCoreInbox, reorgMessageCount *big.Int) error
Types ¶
type ArbCore ¶
type ArbCore interface { ArbCoreLookup ArbCoreInbox LogsCursor StartThread() bool StopThread() MachineIdle() bool }
type ArbCoreInbox ¶
type ArbCoreInbox interface { DeliverMessages(messages []inbox.InboxMessage, previousInboxAcc common.Hash, lastBlockComplete bool, reorgHeight *big.Int) bool MessagesStatus() (MessageStatus, error) }
type ArbCoreLookup ¶
type ArbCoreLookup interface { ArbOutputLookup GetInboxAcc(index *big.Int) (common.Hash, error) GetInboxAccPair(index1 *big.Int, index2 *big.Int) (common.Hash, common.Hash, error) MachineMessagesRead() *big.Int // GetExecutionCursor returns a cursor containing the machine after executing totalGasUsed // from the original machine GetExecutionCursor(totalGasUsed *big.Int) (ExecutionCursor, error) // Advance executes as much as it can without going over maxGas or // optionally until it reaches or goes over maxGas AdvanceExecutionCursor(executionCursor ExecutionCursor, maxGas *big.Int, goOverGas bool) error // TakeMachine takes ownership of machine such that ExecutionCursor will // no longer be able to advance. TakeMachine(executionCursor ExecutionCursor) (machine.Machine, error) }
type ArbOutputLookup ¶
type ArbOutputLookup interface { GetLogCount() (*big.Int, error) GetLogs(startIndex, count *big.Int) ([]value.Value, error) GetSendCount() (*big.Int, error) GetSends(startIndex, count *big.Int) ([][]byte, error) GetMessageCount() (*big.Int, error) GetMessages(startIndex, count *big.Int) ([]inbox.InboxMessage, error) GetMachineForSideload(uint64) (machine.Machine, error) }
type Assertion ¶
type Assertion struct { Before *ExecutionState After *ExecutionState }
func NewAssertionFromFields ¶
func (*Assertion) AfterExecutionHash ¶
func (*Assertion) BeforeExecutionHash ¶
func (*Assertion) BytesFields ¶
func (*Assertion) ExecutionHash ¶
type BigIntList ¶
func (BigIntList) Len ¶
func (l BigIntList) Len() int
func (BigIntList) Less ¶
func (l BigIntList) Less(i, j int) bool
func (BigIntList) Swap ¶
func (l BigIntList) Swap(i, j int)
type Bisection ¶
type Bisection struct { ChallengedSegment *ChallengeSegment Cuts []Cut }
type ChallengeKind ¶
type ChallengeKind uint8
const ( Uninitialized ChallengeKind = iota Execution StoppedShort NoChallenge )
type ExecutionCursor ¶
type ExecutionState ¶
type ExecutionState struct { MachineHash common.Hash InboxAcc common.Hash TotalMessagesRead *big.Int TotalGasConsumed *big.Int TotalSendCount *big.Int TotalLogCount *big.Int SendAcc common.Hash LogAcc common.Hash }
func NewExecutionState ¶
func NewExecutionState(c ExecutionCursor) *ExecutionState
func (*ExecutionState) CutHash ¶
func (e *ExecutionState) CutHash() [32]byte
func (*ExecutionState) Equals ¶
func (e *ExecutionState) Equals(other Cut) bool
func (*ExecutionState) IsPermanentlyBlocked ¶
func (e *ExecutionState) IsPermanentlyBlocked() bool
func (*ExecutionState) RestHash ¶
func (e *ExecutionState) RestHash() [32]byte
type ExecutionTracker ¶
type ExecutionTracker struct {
// contains filtered or unexported fields
}
func NewExecutionTracker ¶
func NewExecutionTracker(lookup ArbCoreLookup, goOverGas bool, stopPointsArg []*big.Int) *ExecutionTracker
func NewExecutionTrackerWithInitialCursor ¶
func NewExecutionTrackerWithInitialCursor(lookup ArbCoreLookup, goOverGas bool, stopPointsArg []*big.Int, initialCursor ExecutionCursor) *ExecutionTracker
func (*ExecutionTracker) GetExecutionCursor ¶
func (e *ExecutionTracker) GetExecutionCursor(gasUsed *big.Int) (ExecutionCursor, error)
func (*ExecutionTracker) GetExecutionState ¶
func (e *ExecutionTracker) GetExecutionState(gasUsed *big.Int) (*ExecutionState, *big.Int, error)
func (*ExecutionTracker) GetMachine ¶
type InMemoryOutputLookup ¶
func NewInMemoryOutputLookup ¶
func NewInMemoryOutputLookup() *InMemoryOutputLookup
func (*InMemoryOutputLookup) GetLog ¶
func (as *InMemoryOutputLookup) GetLog(index uint64) (value.Value, error)
func (*InMemoryOutputLookup) GetLogCount ¶
func (as *InMemoryOutputLookup) GetLogCount() (*big.Int, error)
func (*InMemoryOutputLookup) GetMessage ¶
func (as *InMemoryOutputLookup) GetMessage(index uint64) (value.Value, error)
func (*InMemoryOutputLookup) GetMessageCount ¶
func (as *InMemoryOutputLookup) GetMessageCount() (*big.Int, error)
func (*InMemoryOutputLookup) GetMessages ¶
func (as *InMemoryOutputLookup) GetMessages(startIndex, count *big.Int) ([]inbox.InboxMessage, error)
func (*InMemoryOutputLookup) GetSendCount ¶
func (as *InMemoryOutputLookup) GetSendCount() (*big.Int, error)
func (*InMemoryOutputLookup) GetSends ¶
func (as *InMemoryOutputLookup) GetSends(startIndex, count *big.Int) ([][]byte, error)
func (*InMemoryOutputLookup) LogCount ¶
func (as *InMemoryOutputLookup) LogCount() (uint64, error)
func (*InMemoryOutputLookup) MessageCount ¶
func (as *InMemoryOutputLookup) MessageCount() (uint64, error)
type LogConsumer ¶
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
func NewLogReader ¶
func NewLogReader(consumer LogConsumer, cursor LogsCursor, cursorIndex *big.Int, maxCount *big.Int, sleepTime time.Duration) *LogReader
type LogsCursor ¶
type LogsCursor interface { LogsCursorRequest(cursorIndex *big.Int, count *big.Int) error LogsCursorGetLogs(cursorIndex *big.Int) (*big.Int, []value.Value, []value.Value, error) LogsCursorCheckError(cursorIndex *big.Int) error LogsCursorConfirmReceived(cursorIndex *big.Int) (bool, error) LogsCursorPosition(cursorIndex *big.Int) (*big.Int, error) }
type MessageStatus ¶
type MessageStatus uint8
const ( MessagesEmpty MessageStatus = iota MessagesReady MessagesSuccess MessagesNeedOlder MessagesError )
type NodeInfo ¶
type NodeInfo struct { NodeNum NodeID BlockProposed *common.BlockId Assertion *Assertion InboxMaxCount *big.Int NodeHash common.Hash AfterInboxAcc [32]byte }
func (*NodeInfo) AfterState ¶
func (*NodeInfo) InitialExecutionBisection ¶
type NodeState ¶
type NodeState struct { ProposedBlock *big.Int InboxMaxCount *big.Int *ExecutionState }
type SimpleCut ¶
type SimpleCut struct {
// contains filtered or unexported fields
}
func NewSimpleCut ¶
Click to show internal directories.
Click to hide internal directories.