Skip to content

Commit

Permalink
fix/remove txSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiden-araki committed Dec 24, 2024
1 parent 692a9d0 commit 12feeff
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions sequencer/coordinator/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ import (
"tokamak-sybil-resistance/common"
"tokamak-sybil-resistance/coordinator/prover"
"tokamak-sybil-resistance/database/historydb"
"tokamak-sybil-resistance/database/kvdb"
"tokamak-sybil-resistance/database/statedb"
"tokamak-sybil-resistance/log"
"tokamak-sybil-resistance/synchronizer"
"tokamak-sybil-resistance/txprocessor"
// "tokamak-sybil-resistance/txselector"
)

Expand Down Expand Up @@ -212,10 +209,10 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (
var l1UserTxs []common.L1Tx
var auths [][]byte

_l1UserTxs, err := p.historyDB.GetUnforgedL1UserTxs(p.state.lastForgeL1TxsNum + 1)
if err != nil {
return nil, nil, common.Wrap(err)
}
// _l1UserTxs, err := p.historyDB.GetUnforgedL1UserTxs(p.state.lastForgeL1TxsNum + 1)
// if err != nil {
// return nil, nil, common.Wrap(err)
// }
// l1UserFutureTxs are the l1UserTxs that are not being forged
// in the next batch, but that are also in the queue for the
// future batches
Expand All @@ -230,27 +227,27 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (
// if err != nil {
// return nil, nil, common.Wrap(err)
// }
var selStateDB *statedb.LocalStateDB
localAccountsDB, err := statedb.NewLocalStateDB(
statedb.Config{
Path: cfg.,
Keep: kvdb.DefaultKeep,
Type: statedb.TypeTxSelector,
NLevels: 0,
},
synchronizerStateDB)

tp := txprocessor.NewTxProcessor(localAccountsDB.StateDB, p.cfg.TxProcessorConfig)
// var selStateDB *statedb.LocalStateDB
// localAccountsDB, err := statedb.NewLocalStateDB(
// statedb.Config{
// Path: cfg.Coordinator,
// Keep: kvdb.DefaultKeep,
// Type: statedb.TypeTxSelector,
// NLevels: 0,
// },
// synchronizerStateDB)

// tp := txprocessor.NewTxProcessor(localAccountsDB.StateDB, p.cfg.TxProcessorConfig)

// TODO: depending on what's happening in txSelector, this might not be necessary as well
if skip, reason, err := p.forgePolicySkipPostSelection(now, l1UserTxs, batchInfo); err != nil {
return nil, nil, common.Wrap(err)
} else if skip {
if err := p.txSelector.Reset(batchInfo.BatchNum-1, false); err != nil {
return nil, nil, common.Wrap(err)
}
return nil, &reason, common.Wrap(err)
}
// if skip, reason, err := p.forgePolicySkipPostSelection(now, l1UserTxs, batchInfo); err != nil {
// return nil, nil, common.Wrap(err)
// } else if skip {
// if err := p.txSelector.Reset(batchInfo.BatchNum-1, false); err != nil {
// return nil, nil, common.Wrap(err)
// }
// return nil, &reason, common.Wrap(err)
// }

p.state.lastScheduledL1BatchBlockNum = p.stats.Eth.LastBlock.Num + 1
p.state.lastForgeL1TxsNum++
Expand Down

0 comments on commit 12feeff

Please sign in to comment.