Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func createSequencer(c config.Config, pool *pool.Pool, state *state.State, ether
// log.Fatal(err)
//}

seq, err := sequencer.New(c.Sequencer, pool, state, etherman, ethTxManager)
seq, err := sequencer.New(c.Sequencer, pool, state, state, etherman, ethTxManager)
if err != nil {
log.Fatal(err)
}
Expand Down
5 changes: 3 additions & 2 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ MaxAllowedFailedCounter = 50
[Sequencer.ProfitabilityChecker]
SendBatchesEvenWhenNotProfitable = true
[Sequencer.Finalizer]
NextGERDeadlineTimeoutInSec = 60
NextForcedBatchDeadlineTimeoutInSec = 60
GERDeadlineTimeoutInSec = 60
ForcedBatchDeadlineTimeoutInSec = 60
SendingToL1DeadlineTimeoutInSec = 60
SleepDurationInMs = 100
ResourcePercentageToCloseBatch = 90

Expand Down
5 changes: 3 additions & 2 deletions config/environments/local/local.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ MaxAllowedFailedCounter = 50
[Sequencer.ProfitabilityChecker]
SendBatchesEvenWhenNotProfitable = "true"
[Sequencer.Finalizer]
NextGERDeadlineTimeoutInSec = 60
NextForcedBatchDeadlineTimeoutInSec = 60
GERDeadlineTimeoutInSec = 60
ForcedBatchDeadlineTimeoutInSec = 60
SendingToL1DeadlineTimeoutInSec = 60
SleepDurationInMs = 100
ResourcePercentageToCloseBatch = 90

Expand Down
150 changes: 0 additions & 150 deletions sequencer/broadcast/mocks/mock_state.go

This file was deleted.

9 changes: 5 additions & 4 deletions sequencer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ type Config struct {

// FinalizerCfg contains the finalizer's configuration properties
type FinalizerCfg struct {
NextGERDeadlineTimeoutInSec types.Duration `mapstructure:"NextGERDeadlineTimeoutInSec"`
NextForcedBatchDeadlineTimeoutInSec types.Duration `mapstructure:"NextForcedBatchDeadlineTimeoutInSec"`
SleepDurationInMs types.Duration `mapstructure:"SleepDurationInMs"`
ResourcePercentageToCloseBatch uint32 `mapstructure:"ResourcePercentageToCloseBatch"`
GERDeadlineTimeoutInSec types.Duration `mapstructure:"GERDeadlineTimeoutInSec"`
ForcedBatchDeadlineTimeoutInSec types.Duration `mapstructure:"ForcedBatchDeadlineTimeoutInSec"`
SendingToL1DeadlineTimeoutInSec types.Duration `mapstructure:"SendingToL1DeadlineTimeoutInSec"`
SleepDurationInMs types.Duration `mapstructure:"SleepDurationInMs"`
ResourcePercentageToCloseBatch uint32 `mapstructure:"ResourcePercentageToCloseBatch"`
}

// MaxSequenceSize is a wrapper type that parses token amount to big int
Expand Down
9 changes: 3 additions & 6 deletions sequencer/dbmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (d *dbManager) StoreProcessedTxAndDeleteFromPool() {
}

// GetWIPBatch returns ready WIP batch
// if lastBatch IS OPEN - load data from it but set wipBatch.initialStateRoot to Last Closed Batch
// if lastBatch IS OPEN - load data from it but set batch.initialStateRoot to Last Closed Batch
// if lastBatch IS CLOSED - open new batch in the database and load all data from the closed one without the txs and increase batch number
func (d *dbManager) GetWIPBatch(ctx context.Context) (*WipBatch, error) {
lastBatch, err := d.GetLastBatch(ctx)
Expand All @@ -178,9 +178,8 @@ func (d *dbManager) GetWIPBatch(ctx context.Context) (*WipBatch, error) {
}

wipBatch := &WipBatch{
batchNumber: lastBatch.BatchNumber,
coinbase: lastBatch.Coinbase,
accInputHash: lastBatch.AccInputHash,
batchNumber: lastBatch.BatchNumber,
coinbase: lastBatch.Coinbase,
// initialStateRoot: lastBatch.StateRoot,
stateRoot: lastBatch.StateRoot,
timestamp: uint64(lastBatch.Timestamp.Unix()),
Expand Down Expand Up @@ -272,9 +271,7 @@ type ClosingBatchParameters struct {
}

func (d *dbManager) CloseBatch(ctx context.Context, params ClosingBatchParameters) error {

// TODO: Create new type txManagerArray and refactor CloseBatch method in state

processingReceipt := state.ProcessingReceipt{
BatchNumber: params.BatchNumber,
StateRoot: params.StateRoot,
Expand Down
Loading