Documentation ¶
Overview ¶
The nonodo model uses a shared-memory paradigm to synchronize between threads.
Index ¶
- type AdvanceInput
- type CompletionStatus
- type Input
- type InputFilter
- type InspectInput
- type NonodoModel
- func (m *NonodoModel) AddAdvanceInput(sender common.Address, payload []byte, blockNumber uint64, timestamp time.Time)
- func (m *NonodoModel) AddInspectInput(payload []byte) int
- func (m *NonodoModel) AddNotice(payload []byte) (int, error)
- func (m *NonodoModel) AddReport(payload []byte) error
- func (m *NonodoModel) AddVoucher(destination common.Address, payload []byte) (int, error)
- func (m *NonodoModel) FinishAndGetNext(accepted bool) Input
- func (m *NonodoModel) GetAdvanceInput(index int) (AdvanceInput, bool)
- func (m *NonodoModel) GetInputs(filter InputFilter, offset int, limit int) []AdvanceInput
- func (m *NonodoModel) GetInspectInput(index int) InspectInput
- func (m *NonodoModel) GetNotice(noticeIndex, inputIndex int) (Notice, bool)
- func (m *NonodoModel) GetNotices(filter OutputFilter, offset int, limit int) []Notice
- func (m *NonodoModel) GetNumInputs(filter InputFilter) int
- func (m *NonodoModel) GetNumNotices(filter OutputFilter) int
- func (m *NonodoModel) GetNumReports(filter OutputFilter) int
- func (m *NonodoModel) GetNumVouchers(filter OutputFilter) int
- func (m *NonodoModel) GetReport(reportIndex, inputIndex int) (Report, bool)
- func (m *NonodoModel) GetReports(filter OutputFilter, offset int, limit int) []Report
- func (m *NonodoModel) GetVoucher(voucherIndex, inputIndex int) (Voucher, bool)
- func (m *NonodoModel) GetVouchers(filter OutputFilter, offset int, limit int) []Voucher
- func (m *NonodoModel) RegisterException(payload []byte) error
- type Notice
- type Output
- type OutputFilter
- type Report
- type Voucher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvanceInput ¶
type AdvanceInput struct { Index int Status CompletionStatus MsgSender common.Address Payload []byte BlockNumber uint64 Timestamp time.Time Vouchers []Voucher Notices []Notice Reports []Report Exception []byte }
Rollups advance input type.
type CompletionStatus ¶
type CompletionStatus int
Completion status for inputs.
const ( CompletionStatusUnprocessed CompletionStatus = iota CompletionStatusAccepted CompletionStatusRejected CompletionStatusException )
type InputFilter ¶
Filter inputs.
func (InputFilter) Filter ¶
func (f InputFilter) Filter(i *AdvanceInput) bool
Return true when the given input should be filtered.
type InspectInput ¶
type InspectInput struct { Index int Status CompletionStatus Payload []byte ProccessedInputCount int Reports []Report Exception []byte }
Rollups inspect input type.
type NonodoModel ¶
type NonodoModel struct {
// contains filtered or unexported fields
}
Nonodo model shared among the internal workers. The model store inputs as pointers because these pointers are shared with the rollup state.
func (*NonodoModel) AddAdvanceInput ¶
func (m *NonodoModel) AddAdvanceInput( sender common.Address, payload []byte, blockNumber uint64, timestamp time.Time, )
Add an advance input to the model.
func (*NonodoModel) AddInspectInput ¶
func (m *NonodoModel) AddInspectInput(payload []byte) int
Add an inspect input to the model. Return the inspect input index that should be used for polling.
func (*NonodoModel) AddNotice ¶
func (m *NonodoModel) AddNotice(payload []byte) (int, error)
Add a notice to the model. Return the notice index within the input. Return an error if the state isn't advance.
func (*NonodoModel) AddReport ¶
func (m *NonodoModel) AddReport(payload []byte) error
Add a report to the model. Return an error if the state isn't advance or inspect.
func (*NonodoModel) AddVoucher ¶
Add a voucher to the model. Return the voucher index within the input. Return an error if the state isn't advance.
func (*NonodoModel) FinishAndGetNext ¶
func (m *NonodoModel) FinishAndGetNext(accepted bool) Input
Finish the current input and get the next one. If there is no input to be processed return nil.
func (*NonodoModel) GetAdvanceInput ¶
func (m *NonodoModel) GetAdvanceInput(index int) (AdvanceInput, bool)
Get the advance input for the given index. Return false if not found.
func (*NonodoModel) GetInputs ¶
func (m *NonodoModel) GetInputs(filter InputFilter, offset int, limit int) []AdvanceInput
Get the inputs given the filter and pagination parameters.
func (*NonodoModel) GetInspectInput ¶
func (m *NonodoModel) GetInspectInput(index int) InspectInput
Get the inspect input from the model.
func (*NonodoModel) GetNotice ¶
func (m *NonodoModel) GetNotice(noticeIndex, inputIndex int) (Notice, bool)
Get the notice for the given index and input index. Return false if not found.
func (*NonodoModel) GetNotices ¶
func (m *NonodoModel) GetNotices(filter OutputFilter, offset int, limit int) []Notice
Get the notices given the filter and pagination parameters.
func (*NonodoModel) GetNumInputs ¶
func (m *NonodoModel) GetNumInputs(filter InputFilter) int
Get the number of inputs given the filter.
func (*NonodoModel) GetNumNotices ¶
func (m *NonodoModel) GetNumNotices(filter OutputFilter) int
Get the number of notices given the filter.
func (*NonodoModel) GetNumReports ¶
func (m *NonodoModel) GetNumReports(filter OutputFilter) int
Get the number of reports given the filter.
func (*NonodoModel) GetNumVouchers ¶
func (m *NonodoModel) GetNumVouchers(filter OutputFilter) int
Get the number of vouchers given the filter.
func (*NonodoModel) GetReport ¶
func (m *NonodoModel) GetReport(reportIndex, inputIndex int) (Report, bool)
Get the report for the given index and input index. Return false if not found.
func (*NonodoModel) GetReports ¶
func (m *NonodoModel) GetReports(filter OutputFilter, offset int, limit int) []Report
Get the reports given the filter and pagination parameters.
func (*NonodoModel) GetVoucher ¶
func (m *NonodoModel) GetVoucher(voucherIndex, inputIndex int) (Voucher, bool)
Get the voucher for the given index and input index. Return false if not found.
func (*NonodoModel) GetVouchers ¶
func (m *NonodoModel) GetVouchers(filter OutputFilter, offset int, limit int) []Voucher
Get the vouchers given the filter and pagination parameters.
func (*NonodoModel) RegisterException ¶
func (m *NonodoModel) RegisterException(payload []byte) error
Finish the current input with an exception. Return an error if the state isn't advance or inspect.
type Output ¶
type Output interface {
GetInputIndex() int
}
Interface implemented by vouchers, notices, and reports.
type OutputFilter ¶
type OutputFilter struct {
InputIndex *int
}
Filter outputs (vouchers, notices, and reports).
func (OutputFilter) Filter ¶
func (f OutputFilter) Filter(o Output) bool
Return true when the given output should be filtered.