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

Algod: support state proofs recoverability #4803

Merged
merged 125 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
598705d
Persist StateProof builders on disk (#4553)
Aharonee Oct 23, 2022
fae555c
State Proof Recoverability: state proof verification tracking (#4570)
almog-t Oct 23, 2022
9ebdbce
fix tests: use better function for waiting
Oct 23, 2022
7f11ab3
Algod: state-proof key deletion safety (#4601)
algonathan Oct 26, 2022
3bac343
merged with avm box changes to master
Nov 2, 2022
e734ed7
fixed tracker db version
Nov 2, 2022
dc631d2
fixed lint error
Nov 2, 2022
194b7ac
updated msgp_gen
Nov 2, 2022
7d55071
built with latest dev tools
Nov 2, 2022
13c0fb4
fixed comment typo
Nov 2, 2022
311bc30
added missing dot
Nov 2, 2022
e569879
Merge pull request #4735 from almog-t/merge-recoverability-master
id-ms Nov 2, 2022
0bd34b8
StateProofs: Use stateproof tracker (#4733)
id-ms Nov 6, 2022
2005611
CR: shorter names for verification data in dcc
Nov 7, 2022
8845eb4
CR: renamed non db insert to append
Nov 7, 2022
a4dae19
renamed mutex
Nov 7, 2022
ec8dda1
CR: now using db queries pointer
Nov 7, 2022
788b50f
CR: using nested struct in tracker.go
Nov 7, 2022
02edfdf
renamed TargetRound to LastAttestedRound
Nov 7, 2022
f9cc17f
fixed potential segfault
Nov 7, 2022
4e01f81
renamed stateProofVerificationData to SPVerificationContext
Nov 8, 2022
2a6bc73
renamed internal stateproofverification struct to spVerification
Nov 8, 2022
30dd781
another rename for stateproofverificationcontext
Nov 8, 2022
e70d7d8
refactored deletion data usage
Nov 8, 2022
f000773
full renamed of stateproofverificationdata to stateproofverificationc…
Nov 8, 2022
eefc0f9
ran msgp again
Nov 8, 2022
f4456ef
stateproofround -> lastattestedround
Nov 9, 2022
c9dd1af
more stateproofround -> lastattestedroun
Nov 9, 2022
478d94c
CR: various renamings
Nov 9, 2022
687258f
StateProofs: Sp verification-tracker last lookup cache (#4780)
algonathan Nov 10, 2022
af27896
merged and renamed relevant variables in feature branch
Nov 10, 2022
f6959af
CR: shortened dcc variables
Nov 13, 2022
e0432f4
Merge pull request #4769 from almog-t/spv-tracking-cr-fixes
almog-t Nov 13, 2022
30de42d
Merge branch 'master' into merge-sp-recovery-with-master
Nov 15, 2022
056719b
Merge pull request #4793 from algoidan/merge-sp-recovery-with-master
id-ms Nov 15, 2022
8180823
StateProofs: Limit builders memory usage and reduce StateProofs signa…
Aharonee Nov 16, 2022
7409b73
Merge branch 'master' into merge-sp-recovery-with-master
Nov 16, 2022
7a2c94d
Merge pull request #4801 from algoidan/merge-sp-recovery-with-master
id-ms Nov 16, 2022
e6ed9eb
make state proof unit-tests synced
Nov 20, 2022
6dd8f40
remove printf
Nov 20, 2022
a85fcda
fix state proof message tests
Nov 20, 2022
75f6ac5
test cache limit on sig handler.
Nov 21, 2022
3a6982e
remove panic from test
Nov 21, 2022
1722455
fix race problem
Nov 21, 2022
d65a96b
refactor AllSigs test
Nov 21, 2022
50f009f
reduce log spamming
Nov 21, 2022
c9bd815
add signature broadcast test
Nov 21, 2022
9c7bf73
Revert "reduce log spamming"
Nov 21, 2022
1b35e37
handling mem issue
Nov 21, 2022
ae2b236
fix Broadcast test
Nov 21, 2022
4726d1d
reduce memory consumption in tests
Nov 22, 2022
d337e8a
CR fixed
Nov 23, 2022
7b9b68e
test builder cache context
Dec 4, 2022
7c8bce1
Merge pull request #4817 from algoidan/sp-recovery-test-refactor
id-ms Dec 4, 2022
d661705
Stateproof Recoverability: verification tracking catchpoint support (…
almog-t Dec 5, 2022
88d857e
fix merge issues
Dec 5, 2022
eab1fff
moving stateproofverification tracker's sql function into a file.
Dec 5, 2022
1e4544d
some refactoring
Dec 6, 2022
2ba5c97
refactoring
Dec 6, 2022
43a72f0
Merge pull request #4863 from algoidan/merge-sp-recoverability-from-m…
id-ms Dec 6, 2022
e5d48e4
merge with master
Dec 11, 2022
ebc6ef2
Merge pull request #4888 from algoidan/merge-sp-recoverability-from-m…
id-ms Dec 11, 2022
3c004a5
Fix catchup stateproof race (#4887)
almog-t Dec 27, 2022
0f58463
merge changes from master
Dec 27, 2022
b1905b4
Merge pull request #4950 from algoidan/merge-sp-recvoery-with-master
id-ms Dec 27, 2022
fe354d8
Apply StateProof transactions on catchup (#4949)
Aharonee Dec 29, 2022
8278b53
StateProofs: Fix CR comments (#4958)
id-ms Jan 1, 2023
42caa30
merge with master
Jan 2, 2023
b3fc3f5
Merge pull request #4959 from algoidan/merge-sp-recoverability-with-m…
id-ms Jan 2, 2023
c1ad50c
Fix flaky unit test
Aharonee Jan 2, 2023
40f1168
Merge branch 'master' into merge-sp-recoverbility-with-master
Jan 15, 2023
9f18d39
Merge pull request #5020 from algoidan/merge-sp-recoverbility-with-ma…
id-ms Jan 15, 2023
7e6d874
Add recoverability catchpoint e2e (#4961)
almog-t Jan 16, 2023
98d5a4f
Refactor insertSigToBuilder and handleSig, avoid unused allocations (…
Aharonee Jan 18, 2023
cd7c667
StateProof Recoverability: Fix CR comments (#5030)
id-ms Jan 19, 2023
816449f
change sp interval in short tests (#5081)
id-ms Jan 31, 2023
ede87b2
fix broken nightly tests
Jan 31, 2023
96d9c3b
merge with master
Jan 31, 2023
57ba79b
refactor sp tracker to support new store
Feb 1, 2023
2272129
use prepare statement
Feb 1, 2023
5b899b6
Merge pull request #5086 from algoidan/merge-sp-recvoerability-with-m…
id-ms Feb 1, 2023
4be1ecb
changed RLock to Lock to properly protect lastFlushTime writes (#5092)
almog-t Feb 1, 2023
1c25270
ledger: eternalData trackers concept
algorandskiy Feb 1, 2023
0ad0943
stateproof: e2e flakey-test AttestorsChange (#5101)
algonathan Feb 2, 2023
827365e
StateProof recoverability CR fixes (#5085)
id-ms Feb 2, 2023
4a2f579
CR fixes
algorandskiy Feb 2, 2023
295177c
Merge remote-tracking branch 'upstream/feature/stateproofs-recoverabi…
algorandskiy Feb 2, 2023
493a5f8
Merge pull request #5099 from algorandskiy/pavel/sp-recov
almog-t Feb 2, 2023
62b0c02
Revert "ledger: eternalData trackers concept" (#5104)
algorandskiy Feb 2, 2023
618736a
Fix metrics test
algorandskiy Feb 2, 2023
c90be81
Merge pull request #5106 from algorandskiy/pavel/sp-recov-test
almog-t Feb 2, 2023
8f8f6f1
Remove unused function to fetch message from db and small refactor
Aharonee Feb 5, 2023
d8ccde8
Fix errors tests log (#5117)
almog-t Feb 6, 2023
e331404
Inline sigExists and builderExists methods
Aharonee Jan 18, 2023
760c231
Stop stateproof worker on catchpoint cathcup and restart when done. (…
Aharonee Feb 16, 2023
f97766a
Merge branch 'master' into spr-merge-with-master
Feb 16, 2023
28c1313
Merge pull request #5144 from algoidan/spr-merge-with-master
id-ms Feb 16, 2023
4b8854b
StateProofRecoverability: fix comments (#5143)
id-ms Feb 16, 2023
f5e16e8
Merge remote-tracking branch 'upstream/master' into feature/stateproo…
algorandskiy Feb 17, 2023
6e2f233
post merge fixes:
algorandskiy Feb 17, 2023
9efe32c
fix lint
algorandskiy Feb 17, 2023
22b3125
Fix exceed partitiontest call
algorandskiy Feb 18, 2023
ecbcc8e
fix flaky test
Feb 19, 2023
ab7a68b
code review: fix interface names as suggested
algorandskiy Feb 21, 2023
8201750
Merge pull master (#5148)
algorandskiy Feb 21, 2023
da1d70f
fix linter in ledger_test.go
algorandskiy Feb 21, 2023
f19a285
StateProof Recvoerability: CR fixes (#5153)
id-ms Feb 24, 2023
52c8bcb
Merge remote-tracking branch 'upstream/master' into feature/stateproo…
algorandskiy Feb 27, 2023
d229775
merge master into feature/stateproofs-recoverability
algorandskiy Feb 27, 2023
0d0697a
Do not stop stateproof service in fast catchup mode (#5170)
algorandskiy Mar 1, 2023
0bc8014
Merge branch 'master' into merge-spr-with-master
Mar 7, 2023
7a2714f
Merge pull request #5179 from algoidan/merge-spr-with-master
id-ms Mar 7, 2023
3d303b0
fix flaky test
Mar 8, 2023
3c831df
CR fixes (#5176)
id-ms Mar 13, 2023
8d31459
Merge remote-tracking branch 'upstream/master' into pavel/stateproofs…
algorandskiy Mar 13, 2023
56cd05b
Merge remote-tracking branch 'upstream/master' into pavel/stateproofs…
algorandskiy Mar 13, 2023
389b8ac
Linter fixes
algorandskiy Mar 13, 2023
4f12cb6
Merge master (#5199)
algorandskiy Mar 13, 2023
c659a1d
Update log message
Aharonee Mar 16, 2023
6e4b414
Add a second mutex to stateproof.Worker to allow more granular locking.
Aharonee Mar 20, 2023
150efa2
convert to rw lock and fix linter error.
Mar 20, 2023
30da8b6
update comments.
Mar 23, 2023
8bf459b
using verification ctx from tracker when creating stats
Mar 29, 2023
fdbe4e5
Merge branch 'master' into merge-sp-recoverability-from-master
Mar 30, 2023
cd7dbcc
Merge pull request #5241 from algoidan/merge-sp-recoverability-from-m…
id-ms Mar 30, 2023
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
Prev Previous commit
Next Next commit
renamed stateProofVerificationData to SPVerificationContext
  • Loading branch information
Almog Tal committed Nov 8, 2022
commit 4e01f819dafaeaedd1cac038d4eebc5bb641928d
4 changes: 2 additions & 2 deletions cmd/tealdbg/localLedger.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ func (l *localLedger) BlockHdrCached(basics.Round) (bookkeeping.BlockHeader, err
return bookkeeping.BlockHeader{}, nil
}

func (l *localLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
return nil, fmt.Errorf("localLedger: StateProofVerificationData is not implemented")
func (l *localLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
return nil, fmt.Errorf("localLedger: SPVerificationContext is not implemented")
}

func (l *localLedger) CheckDup(config.ConsensusParams, basics.Round, basics.Round, basics.Round, transactions.Txid, ledgercore.Txlease) error {
Expand Down
4 changes: 2 additions & 2 deletions daemon/algod/api/server/v2/dryrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ func (dl *dryrunLedger) CheckDup(config.ConsensusParams, basics.Round, basics.Ro
return nil
}

func (dl *dryrunLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
return nil, fmt.Errorf("dryrunLedger: StateProofVerificationData is not implemented")
func (dl *dryrunLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
return nil, fmt.Errorf("dryrunLedger: SPVerificationContext is not implemented")
}

func (dl *dryrunLedger) lookup(rnd basics.Round, addr basics.Address) (basics.AccountData, basics.Round, error) {
Expand Down
4 changes: 2 additions & 2 deletions ledger/accountdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5364,8 +5364,8 @@ func stateProofVerificationInitDbQueries(r db.Queryable) (*stateProofVerificatio
return qs, nil
}

func (qs *stateProofVerificationDbQueries) lookupData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error) {
data := ledgercore.StateProofVerificationData{}
func (qs *stateProofVerificationDbQueries) lookupData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error) {
data := ledgercore.SPVerificationContext{}
queryFunc := func() error {
row := qs.lookupStateProofVerificationData.QueryRow(stateProofLastAttestedRound)
var buf []byte
Expand Down
2 changes: 1 addition & 1 deletion ledger/acctupdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ func (aul *accountUpdatesLedgerEvaluator) VotersForStateProof(rnd basics.Round)
return aul.ao.voters.getVoters(rnd)
}

func (aul *accountUpdatesLedgerEvaluator) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
func (aul *accountUpdatesLedgerEvaluator) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
// this function should not be used by accountUpdatesLedgerEvaluator
return nil, fmt.Errorf("accountUpdatesLedgerEvaluator: tried to get stateProofVerification data during accountUpdates initialization ")
}
Expand Down
2 changes: 1 addition & 1 deletion ledger/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type StateProofsApplier interface {
BlockHdr(r basics.Round) (bookkeeping.BlockHeader, error)
GetStateProofNextRound() basics.Round
SetStateProofNextRound(rnd basics.Round)
StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error)
StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error)
}

// Balances allow to move MicroAlgos from one address to another and to update balance records, or to access and modify individual balance records
Expand Down
6 changes: 3 additions & 3 deletions ledger/apply/stateproof.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func StateProof(tx transactions.StateProofTxnFields, atRound basics.Round, sp St
return err
}

var verificationData *ledgercore.StateProofVerificationData
var verificationData *ledgercore.SPVerificationContext
if config.Consensus[atRoundHdr.CurrentProtocol].StateProofUseTrackerVerification {
verificationData, err = sp.StateProofVerificationData(lastRoundInInterval)
} else {
Expand All @@ -73,7 +73,7 @@ func StateProof(tx transactions.StateProofTxnFields, atRound basics.Round, sp St
return nil
}

func gatherVerificationDataUsingBlockHeaders(sp StateProofsApplier, lastRoundInInterval basics.Round) (*ledgercore.StateProofVerificationData, error) {
func gatherVerificationDataUsingBlockHeaders(sp StateProofsApplier, lastRoundInInterval basics.Round) (*ledgercore.SPVerificationContext, error) {
lastRoundHdr, err := sp.BlockHdr(lastRoundInInterval)
if err != nil {
return nil, err
Expand All @@ -85,7 +85,7 @@ func gatherVerificationDataUsingBlockHeaders(sp StateProofsApplier, lastRoundInI
return nil, err
}

verificationData := ledgercore.StateProofVerificationData{
verificationData := ledgercore.SPVerificationContext{
LastAttestedRound: lastRoundInInterval,
VotersCommitment: votersHdr.StateProofTracking[protocol.StateProofBasic].StateProofVotersCommitment,
OnlineTotalWeight: votersHdr.StateProofTracking[protocol.StateProofBasic].StateProofOnlineTotalWeight,
Expand Down
4 changes: 2 additions & 2 deletions ledger/evalindexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ func (l indexerLedgerConnector) VotersForStateProof(_ basics.Round) (*ledgercore
}

// StateProofVerificationData is part of LedgerForEvaluator interface.
func (l indexerLedgerConnector) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
func (l indexerLedgerConnector) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
// This function is not used by evaluator.
return nil, errors.New("StateProofVerificationData() not implemented")
return nil, errors.New("SPVerificationContext() not implemented")
}

func makeIndexerLedgerConnector(il indexerLedgerForEval, genesisHash crypto.Digest, genesisProto config.ConsensusParams, latestRound basics.Round, roundResources EvalForIndexerResources) indexerLedgerConnector {
Expand Down
4 changes: 2 additions & 2 deletions ledger/internal/appcow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func (ml *emptyLedger) GetStateProofNextRound() basics.Round {
return basics.Round(0)
}

func (ml *emptyLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
return nil, fmt.Errorf("emptyLedger does not implement StateProofVerificationData")
func (ml *emptyLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
return nil, fmt.Errorf("emptyLedger does not implement SPVerificationContext")
}

type modsData struct {
Expand Down
4 changes: 2 additions & 2 deletions ledger/internal/cow.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type roundCowParent interface {
allocated(addr basics.Address, aidx basics.AppIndex, global bool) (bool, error)
getKey(addr basics.Address, aidx basics.AppIndex, global bool, key string, accountIdx uint64) (basics.TealValue, bool, error)
kvGet(key string) ([]byte, bool, error)
StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error)
StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error)
}

type roundCowState struct {
Expand Down Expand Up @@ -241,7 +241,7 @@ func (cb *roundCowState) BlockHdr(r basics.Round) (bookkeeping.BlockHeader, erro
return cb.lookupParent.BlockHdr(r)
}

func (cb *roundCowState) StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error) {
func (cb *roundCowState) StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error) {
return cb.lookupParent.StateProofVerificationData(stateProofLastAttestedRound)
}

Expand Down
4 changes: 2 additions & 2 deletions ledger/internal/cow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type mockLedger struct {
balanceMap map[basics.Address]basics.AccountData
blocks map[basics.Round]bookkeeping.BlockHeader
blockErr map[basics.Round]error
stateProofVerification map[basics.Round]*ledgercore.StateProofVerificationData
stateProofVerification map[basics.Round]*ledgercore.SPVerificationContext
}

func (ml *mockLedger) lookup(addr basics.Address) (ledgercore.AccountData, error) {
Expand Down Expand Up @@ -112,7 +112,7 @@ func (ml *mockLedger) blockHdrCached(rnd basics.Round) (bookkeeping.BlockHeader,
return ml.blockHdrCached(rnd)
}

func (ml *mockLedger) StateProofVerificationData(rnd basics.Round) (*ledgercore.StateProofVerificationData, error) {
func (ml *mockLedger) StateProofVerificationData(rnd basics.Round) (*ledgercore.SPVerificationContext, error) {
element, exists := ml.stateProofVerification[rnd]
if !exists {
return nil, fmt.Errorf("requested state proof verification data not found")
Expand Down
4 changes: 2 additions & 2 deletions ledger/internal/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type LedgerForCowBase interface {
LookupApplication(basics.Round, basics.Address, basics.AppIndex) (ledgercore.AppResource, error)
LookupKv(basics.Round, string) ([]byte, error)
GetCreatorForRound(basics.Round, basics.CreatableIndex, basics.CreatableType) (basics.Address, bool, error)
StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error)
StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error)
}

// ErrRoundZero is self-explanatory
Expand Down Expand Up @@ -338,7 +338,7 @@ func (x *roundCowBase) BlockHdr(r basics.Round) (bookkeeping.BlockHeader, error)
return x.l.BlockHdr(r)
}

func (x *roundCowBase) StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error) {
func (x *roundCowBase) StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error) {
return x.l.StateProofVerificationData(stateProofLastAttestedRound)
}

Expand Down
12 changes: 6 additions & 6 deletions ledger/internal/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func TestCowStateProof(t *testing.T) {
c0 := makeRoundCowState(
&ml, bookkeeping.BlockHeader{}, config.Consensus[protocol.ConsensusFuture],
0, ledgercore.AccountTotals{}, 0)
ml.stateProofVerification = make(map[basics.Round]*ledgercore.StateProofVerificationData)
ml.stateProofVerification = make(map[basics.Round]*ledgercore.SPVerificationContext)

spType = protocol.StateProofType(1234) // bad stateproof type
stateProofTx := transactions.StateProofTxnFields{
Expand Down Expand Up @@ -375,7 +375,7 @@ func TestCowStateProof(t *testing.T) {
blockErr[256] = noBlockErr
stateProofTx.Message.LastAttestedRound = 512
stateProofTx.StateProof.SignedWeight = 100
ml.stateProofVerification[basics.Round(stateProofTx.Message.LastAttestedRound)] = &ledgercore.StateProofVerificationData{
ml.stateProofVerification[basics.Round(stateProofTx.Message.LastAttestedRound)] = &ledgercore.SPVerificationContext{
LastAttestedRound: basics.Round(stateProofTx.Message.LastAttestedRound),
VotersCommitment: []byte{0x1}[:],
OnlineTotalWeight: basics.MicroAlgos{Raw: 5},
Expand Down Expand Up @@ -719,8 +719,8 @@ func (ledger *evalTestLedger) Latest() basics.Round {
return basics.Round(len(ledger.blocks)).SubSaturate(1)
}

func (ledger *evalTestLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
return nil, fmt.Errorf("evalTestLedger does not implement StateProofVerificationData")
func (ledger *evalTestLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
return nil, fmt.Errorf("evalTestLedger does not implement SPVerificationContext")
}

// AddValidatedBlock adds a new block to the ledger, after the block has
Expand Down Expand Up @@ -898,8 +898,8 @@ func (l *testCowBaseLedger) LookupKv(rnd basics.Round, key string) ([]byte, erro
return nil, errors.New("not implemented")
}

func (l *testCowBaseLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
return nil, fmt.Errorf("testCowBaseLedger does not implement StateProofVerificationData")
func (l *testCowBaseLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
return nil, fmt.Errorf("testCowBaseLedger does not implement SPVerificationContext")
}

func (l *testCowBaseLedger) GetCreatorForRound(_ basics.Round, cindex basics.CreatableIndex, ctype basics.CreatableType) (basics.Address, bool, error) {
Expand Down
4 changes: 2 additions & 2 deletions ledger/internal/prefetcher/prefetcher_alignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func (l *prefetcherAlignmentTestLedger) CheckDup(config.ConsensusParams, basics.
return nil
}

func (l *prefetcherAlignmentTestLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.StateProofVerificationData, error) {
return nil, fmt.Errorf("prefetcherAlignmentTestLedger does not implement StateProofVerificationData")
func (l *prefetcherAlignmentTestLedger) StateProofVerificationData(_ basics.Round) (*ledgercore.SPVerificationContext, error) {
return nil, fmt.Errorf("prefetcherAlignmentTestLedger does not implement SPVerificationContext")
}

func (l *prefetcherAlignmentTestLedger) LookupWithoutRewards(_ basics.Round, addr basics.Address) (ledgercore.AccountData, basics.Round, error) {
Expand Down
2 changes: 1 addition & 1 deletion ledger/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ func (l *Ledger) VotersForStateProof(rnd basics.Round) (*ledgercore.VotersForRou

// StateProofVerificationData returns the data required to verify the state proof whose last attested round is
// stateProofLastAttestedRound.
func (l *Ledger) StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.StateProofVerificationData, error) {
func (l *Ledger) StateProofVerificationData(stateProofLastAttestedRound basics.Round) (*ledgercore.SPVerificationContext, error) {
l.trackerMu.RLock()
algorandskiy marked this conversation as resolved.
Show resolved Hide resolved
defer l.trackerMu.RUnlock()
return l.stateProofVerification.LookupVerificationData(stateProofLastAttestedRound)
Expand Down
32 changes: 16 additions & 16 deletions ledger/ledgercore/msgp_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions ledger/ledgercore/msgp_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ledger/ledgercore/stateproofverification.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/algorand/go-algorand/protocol"
)

// StateProofVerificationData represents the data provided by the ledger to verify a state proof transaction.
type StateProofVerificationData struct {
// SPVerificationContext represents the context provided by the ledger to verify a state proof transaction.
type SPVerificationContext struct {
_struct struct{} `codec:",omitempty,omitemptyarray"`

// LastAttestedRound is the last attested round of the state proof verified using this data.
Expand Down
Loading