Skip to content
Open
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
15 changes: 0 additions & 15 deletions db/state/execctx/domain_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ type SharedDomains struct {

logger log.Logger

txNum uint64
currentStep kv.Step
trace bool //nolint
commitmentCapture bool
mem kv.TemporalMemBatch
Expand Down Expand Up @@ -168,8 +166,6 @@ func (sd *SharedDomains) Merge(sdTxNum uint64, other *SharedDomains, otherTxNum
sd.sdCtx.SetPendingUpdate(otherUpd)
}

sd.txNum = otherTxNum
sd.currentStep = kv.Step(otherTxNum / sd.stepSize)
return nil
}

Expand Down Expand Up @@ -312,15 +308,6 @@ func (sd *SharedDomains) IndexAdd(table kv.InvertedIdx, key []byte, txNum uint64

func (sd *SharedDomains) StepSize() uint64 { return sd.stepSize }

// SetTxNum sets txNum for all domains as well as common txNum for all domains
// Requires for sd.rwTx because of commitment evaluation in shared domains if stepSize is reached
func (sd *SharedDomains) SetTxNum(txNum uint64) {
sd.txNum = txNum
sd.currentStep = kv.Step(txNum / sd.stepSize)
}

func (sd *SharedDomains) TxNum() uint64 { return sd.txNum }

func (sd *SharedDomains) SetTrace(b, capture bool) []string {
sd.trace = b
sd.commitmentCapture = capture
Expand All @@ -340,7 +327,6 @@ func (sd *SharedDomains) Close() {
return
}

sd.SetTxNum(0)
sd.ResetPendingUpdates()

//sd.walLock.Lock()
Expand Down Expand Up @@ -626,7 +612,6 @@ func (sd *SharedDomains) SeekCommitment(ctx context.Context, tx kv.TemporalTx) (
if err != nil {
return 0, 0, err
}
sd.SetTxNum(txNum)
return txNum, blockNum, nil
}

Expand Down
1 change: 0 additions & 1 deletion db/state/squeeze.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ func RebuildCommitmentFiles(ctx context.Context, rwDb kv.TemporalRwDB, txNumsRea
return nil, err
}

domains.SetTxNum(lastTxnumInShard - 1)
currentTxNum := lastTxnumInShard - 1
domains.GetCommitmentCtx().SetLimitedHistoryStateReader(rwTx, lastTxnumInShard) // this helps to read state from correct file during commitment

Expand Down
2 changes: 0 additions & 2 deletions execution/commitment/commitmentdb/commitment_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ var (
)

type sd interface {
SetTxNum(blockNum uint64)
AsGetter(tx kv.TemporalTx) kv.TemporalGetter
AsPutDel(tx kv.TemporalTx) kv.TemporalPutDel
StepSize() uint64
TxNum() uint64

Trace() bool
CommitmentCapture() bool
Expand Down
1 change: 0 additions & 1 deletion execution/stagedsync/exec3_parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ func (pe *parallelExecutor) exec(ctx context.Context, execStage *StageState, u U

if applyResult.BlockNum > lastBlockResult.BlockNum {
uncommittedBlocks++
pe.doms.SetTxNum(applyResult.lastTxNum)
lastBlockResult = *applyResult
}

Expand Down
1 change: 0 additions & 1 deletion execution/stagedsync/exec3_serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ func (se *serialExecutor) executeBlock(ctx context.Context, tasks []exec.Task, i
return false, err
}

se.doms.SetTxNum(txTask.TxNum)
se.lastBlockResult = &blockResult{
BlockNum: txTask.BlockNumber(),
lastTxNum: txTask.TxNum,
Expand Down
1 change: 0 additions & 1 deletion execution/stagedsync/stage_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ func unwindExec3State(ctx context.Context,
}

sd.Unwind(txUnwindTo, changeset)
sd.SetTxNum(txUnwindTo)
return nil
}

Expand Down
Loading