Documentation ¶
Overview ¶
The nonodo model uses a shared-memory paradigm to synchronize between threads.
Index ¶
- func FinishAndGetNext(m *NonodoModel, accept bool) (cModel.Input, error)
- type Decoder
- type EspressoSequencer
- type InputBoxSequencer
- type InputFilter
- type InspectInput
- type MetadataFilter
- type NonodoModel
- func (m *NonodoModel) AddAdvanceInput(sender common.Address, payload []byte, blockNumber uint64, timestamp time.Time, ...) error
- 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) (cModel.Input, error)
- func (m *NonodoModel) GetInputRepository() *cRepos.InputRepository
- func (m *NonodoModel) GetInspectInput(index int) (InspectInput, error)
- func (m *NonodoModel) RegisterException(payload []byte) error
- type Notice
- type Output
- type OutputFilter
- type Report
- type Sequencer
- type Voucher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FinishAndGetNext ¶ added in v1.3.0
func FinishAndGetNext(m *NonodoModel, accept bool) (cModel.Input, error)
Types ¶
type Decoder ¶
type Decoder interface { HandleOutput( ctx context.Context, destination common.Address, payload string, inputIndex uint64, outputIndex uint64, ) error }
Convenience OutputDecoder
type EspressoSequencer ¶ added in v1.3.0
type EspressoSequencer struct {
// contains filtered or unexported fields
}
func NewEspressoSequencer ¶ added in v1.3.0
func NewEspressoSequencer(model *NonodoModel) *EspressoSequencer
func (*EspressoSequencer) FinishAndGetNext ¶ added in v1.3.0
func (es *EspressoSequencer) FinishAndGetNext(accept bool) (cModel.Input, error)
type InputBoxSequencer ¶ added in v1.3.0
type InputBoxSequencer struct {
// contains filtered or unexported fields
}
func NewInputBoxSequencer ¶ added in v1.3.0
func NewInputBoxSequencer(model *NonodoModel) *InputBoxSequencer
func (*InputBoxSequencer) FinishAndGetNext ¶ added in v1.3.0
func (ibs *InputBoxSequencer) FinishAndGetNext(accept bool) (cModel.Input, error)
type InputFilter ¶
Filter inputs.
func (InputFilter) Filter ¶
func (f InputFilter) Filter(i *cModel.AdvanceInput) bool
Return true when the given input should be filtered.
type InspectInput ¶
type InspectInput struct { Index int Status cModel.CompletionStatus Payload []byte ProcessedInputCount int Reports []Report Exception []byte }
Rollups inspect input type.
type MetadataFilter ¶
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 NewNonodoModel ¶
func NewNonodoModel( decoder Decoder, reportRepository *cRepos.ReportRepository, inputRepository *cRepos.InputRepository, ) *NonodoModel
Create a new model.
func (*NonodoModel) AddAdvanceInput ¶
func (m *NonodoModel) AddAdvanceInput( sender common.Address, payload []byte, blockNumber uint64, timestamp time.Time, index int, ) error
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) (cModel.Input, error)
Finish the current input and get the next one. If there is no input to be processed return nil.
Note: use in v2 the sequencer instead.
func (*NonodoModel) GetInputRepository ¶ added in v1.3.0
func (m *NonodoModel) GetInputRepository() *cRepos.InputRepository
func (*NonodoModel) GetInspectInput ¶
func (m *NonodoModel) GetInspectInput(index int) (InspectInput, error)
Get the inspect input from the model.
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.