Documentation ¶
Index ¶
- Variables
- type Contester
- type ProofBuffer
- func (pb *ProofBuffer) ClearItems(blockIDs ...uint64) int
- func (pb *ProofBuffer) Enabled() bool
- func (pb *ProofBuffer) IsAggregating() bool
- func (pb *ProofBuffer) LastUpdatedAt() time.Time
- func (pb *ProofBuffer) Len() int
- func (pb *ProofBuffer) MarkAggregating()
- func (pb *ProofBuffer) Read(length int) ([]*producer.ProofWithHeader, error)
- func (pb *ProofBuffer) ReadAll() ([]*producer.ProofWithHeader, error)
- func (pb *ProofBuffer) UpdateLastUpdatedAt()
- func (pb *ProofBuffer) Write(item *producer.ProofWithHeader) (int, error)
- type ProofContester
- type ProofSubmitter
- func (s *ProofSubmitter) AggregateProofs(ctx context.Context) error
- func (s *ProofSubmitter) AggregationEnabled() bool
- func (s *ProofSubmitter) BatchSubmitProofs(ctx context.Context, batchProof *proofProducer.BatchProofs) error
- func (s *ProofSubmitter) BufferSize() uint64
- func (s *ProofSubmitter) Producer() proofProducer.ProofProducer
- func (s *ProofSubmitter) RequestProof(ctx context.Context, meta metadata.TaikoBlockMetaData) error
- func (s *ProofSubmitter) SubmitProof(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) (err error)
- func (s *ProofSubmitter) Tier() uint16
- type Submitter
Constants ¶
This section is empty.
Variables ¶
var ( ProofTimeout = 3 * time.Hour ErrInvalidProof = errors.New("invalid proof found") )
Functions ¶
This section is empty.
Types ¶
type Contester ¶
type Contester interface { SubmitContest( ctx context.Context, blockID *big.Int, proposedIn *big.Int, parentHash common.Hash, meta metadata.TaikoBlockMetaData, tier uint16, ) error }
Contester is the interface for contesting proofs of the L2 blocks.
type ProofBuffer ¶
type ProofBuffer struct { MaxLength uint64 // contains filtered or unexported fields }
ProofBuffer caches all single proof with a fixed size.
func NewProofBuffer ¶
func NewProofBuffer(maxLength uint64) *ProofBuffer
NewProofBuffer creates a new ProofBuffer instance.
func (*ProofBuffer) ClearItems ¶
func (pb *ProofBuffer) ClearItems(blockIDs ...uint64) int
ClearItems clears items that has given block ids in the buffer.
func (*ProofBuffer) Enabled ¶
func (pb *ProofBuffer) Enabled() bool
Enabled returns if the buffer is enabled.
func (*ProofBuffer) IsAggregating ¶
func (pb *ProofBuffer) IsAggregating() bool
IsAggregating returns if the proofs in this buffer are aggregating.
func (*ProofBuffer) LastUpdatedAt ¶
func (pb *ProofBuffer) LastUpdatedAt() time.Time
LastUpdatedAt returns the last updated time of the buffer.
func (*ProofBuffer) Len ¶
func (pb *ProofBuffer) Len() int
Len returns current length of the buffer.
func (*ProofBuffer) MarkAggregating ¶
func (pb *ProofBuffer) MarkAggregating()
MarkAggregating marks the proofs in this buffer are aggregating.
func (*ProofBuffer) Read ¶
func (pb *ProofBuffer) Read(length int) ([]*producer.ProofWithHeader, error)
Read returns the content with given length in the buffer.
func (*ProofBuffer) ReadAll ¶
func (pb *ProofBuffer) ReadAll() ([]*producer.ProofWithHeader, error)
ReadAll returns all the content in the buffer.
func (*ProofBuffer) UpdateLastUpdatedAt ¶
func (pb *ProofBuffer) UpdateLastUpdatedAt()
LastUpdatedAt returns the last updated time of the buffer.
func (*ProofBuffer) Write ¶
func (pb *ProofBuffer) Write(item *producer.ProofWithHeader) (int, error)
Write adds new item to the buffer.
type ProofContester ¶
type ProofContester struct {
// contains filtered or unexported fields
}
ProofContester is responsible for contesting wrong L2 transitions.
func NewProofContester ¶
func NewProofContester( rpcClient *rpc.Client, gasLimit uint64, txmgr *txmgr.SimpleTxManager, privateTxmgr *txmgr.SimpleTxManager, proverSetAddress common.Address, graffiti string, builder *transaction.ProveBlockTxBuilder, ) *ProofContester
NewProofContester creates a new ProofContester instance.
func (*ProofContester) SubmitContest ¶
func (c *ProofContester) SubmitContest( ctx context.Context, blockID *big.Int, proposedIn *big.Int, parentHash common.Hash, meta metadata.TaikoBlockMetaData, tier uint16, ) error
SubmitContest submits a TaikoL1.proveBlock transaction to contest a L2 block transition.
type ProofSubmitter ¶
type ProofSubmitter struct {
// contains filtered or unexported fields
}
ProofSubmitter is responsible requesting proofs for the given L2 blocks, and submitting the generated proofs to the TaikoL1 smart contract.
func NewProofSubmitter ¶
func NewProofSubmitter( rpcClient *rpc.Client, proofProducer proofProducer.ProofProducer, resultCh chan *proofProducer.ProofWithHeader, batchResultCh chan *proofProducer.BatchProofs, aggregationNotify chan uint16, proverSetAddress common.Address, taikoL2Address common.Address, graffiti string, gasLimit uint64, txmgr *txmgr.SimpleTxManager, privateTxmgr *txmgr.SimpleTxManager, builder *transaction.ProveBlockTxBuilder, tiers []*rpc.TierProviderTierWithID, isGuardian bool, submissionDelay time.Duration, proofBufferSize uint64, forceBatchProvingInterval time.Duration, ) (*ProofSubmitter, error)
NewProofSubmitter creates a new ProofSubmitter instance.
func (*ProofSubmitter) AggregateProofs ¶
func (s *ProofSubmitter) AggregateProofs(ctx context.Context) error
AggregateProofs read all data from buffer and aggregate them.
func (*ProofSubmitter) AggregationEnabled ¶
func (s *ProofSubmitter) AggregationEnabled() bool
AggregationEnabled returns whether the proof submitter's aggregation feature is enabled.
func (*ProofSubmitter) BatchSubmitProofs ¶
func (s *ProofSubmitter) BatchSubmitProofs(ctx context.Context, batchProof *proofProducer.BatchProofs) error
BatchSubmitProofs implements the Submitter interface to submit proof aggregation.
func (*ProofSubmitter) BufferSize ¶
func (s *ProofSubmitter) BufferSize() uint64
BufferSize returns the size of the proof buffer.
func (*ProofSubmitter) Producer ¶
func (s *ProofSubmitter) Producer() proofProducer.ProofProducer
Producer returns the inner proof producer.
func (*ProofSubmitter) RequestProof ¶
func (s *ProofSubmitter) RequestProof(ctx context.Context, meta metadata.TaikoBlockMetaData) error
RequestProof implements the Submitter interface.
func (*ProofSubmitter) SubmitProof ¶
func (s *ProofSubmitter) SubmitProof( ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader, ) (err error)
SubmitProof implements the Submitter interface.
func (*ProofSubmitter) Tier ¶
func (s *ProofSubmitter) Tier() uint16
Tier returns the proof tier of the current proof submitter.
type Submitter ¶
type Submitter interface { RequestProof(ctx context.Context, meta metadata.TaikoBlockMetaData) error SubmitProof(ctx context.Context, proofWithHeader *proofProducer.ProofWithHeader) error BatchSubmitProofs(ctx context.Context, proofsWithHeaders *proofProducer.BatchProofs) error AggregateProofs(ctx context.Context) error Producer() proofProducer.ProofProducer Tier() uint16 BufferSize() uint64 AggregationEnabled() bool }
Submitter is the interface for submitting proofs of the L2 blocks.