Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ledger: update EvalForIndexer to avoid totals computation #2941

Merged
merged 1 commit into from
Sep 23, 2021
Merged
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
9 changes: 4 additions & 5 deletions ledger/evalIndexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,10 @@ func EvalForIndexer(il indexerLedgerForEval, block *bookkeeping.Block, proto con
fmt.Errorf("EvalForIndexer() err: %w", err)
}

err = eval.finalValidation()
if err != nil {
return ledgercore.StateDelta{}, []transactions.SignedTxnInBlock{},
fmt.Errorf("EvalForIndexer() err: %w", err)
}
// here, in the EvalForIndexer, we don't want to call finalValidation(). This would
// skip the calculation of the account totals in the state delta, which is a serious
// issue if it were to be used by algod, but it's perfectly fine for the indexer since
// it doesn't track any totals and therefore cannot calculate the new totals.

return eval.state.deltas(), eval.block.Payset, nil
}