builder

package
v0.15.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NumTxnsToBatchExecute = 10
	ErrPendingParentHash  = errors.New("pending block parent hash does not match chain head")
)

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func New

func New(privKey *ecdsa.PrivateKey, ownAddr *felt.Felt, bc *blockchain.Blockchain, vm vm.VM,
	blockTime time.Duration, mempool *mempool.Pool, log utils.Logger, disableFees bool, database db.KeyValueStore,
) Builder

func (*Builder) ClearPending

func (b *Builder) ClearPending() error

func (*Builder) Finalise

func (b *Builder) Finalise(signFunc blockchain.BlockSignFunc) error

Finalise the pending block and initialise the next one

func (*Builder) HighestBlockHeader

func (b *Builder) HighestBlockHeader() *core.Header

func (*Builder) InitPendingBlock

func (b *Builder) InitPendingBlock() error

func (*Builder) Pending

func (b *Builder) Pending() (*sync.Pending, error)

func (*Builder) PendingBlock

func (b *Builder) PendingBlock() *core.Block

func (*Builder) PendingState

func (b *Builder) PendingState() (core.StateReader, func() error, error)

func (*Builder) Run

func (b *Builder) Run(ctx context.Context) error

func (*Builder) Sign

func (b *Builder) Sign(blockHash, stateDiffCommitment *felt.Felt) ([]*felt.Felt, error)

Sign returns the builder's signature over data.

func (*Builder) StartingBlockNumber

func (b *Builder) StartingBlockNumber() (uint64, error)

func (*Builder) StorePending

func (b *Builder) StorePending(newPending *sync.Pending) error

StorePending stores a pending block given that it is for the next height

func (*Builder) SubscribeNewHeads

func (b *Builder) SubscribeNewHeads() sync.NewHeadSubscription

func (*Builder) SubscribePending

func (b *Builder) SubscribePending() sync.PendingSubscription

func (*Builder) SubscribeReorg

func (b *Builder) SubscribeReorg() sync.ReorgSubscription

The builder has no reorg logic (centralised sequencer that can't reorg)

func (*Builder) WithPlugin

func (b *Builder) WithPlugin(junoPlugin plugin.JunoPlugin) *Builder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL