Skip to content

Commit

Permalink
go mod tidier
Browse files Browse the repository at this point in the history
wip

netdeploy: Copy ledger directory for kv tracker database (algorand#5392)

assembler: Error if extra args are present in pragmas (algorand#5400)

ledger: Exclude stake at R-320 that is expired by R (algorand#5403)

Co-authored-by: cce <[email protected]>

algod: Don't return a top level array from algod (algorand#5404)

revert

go get github.com/algorand/[email protected]

go get github.com/getkin/[email protected]

go mod tidy -compat=1.17

go get github.com/algorand/[email protected]

go mod tidy -compat=1.17

go get github.com/algorand/[email protected]

revert to master

github.com/getkin/kin-openapi v0.117.0

github.com/getkin/kin-openapi v0.117.0

github.com/getkin/kin-openapi v0.117.0

go get golang.org/x/mod/modfile

tidy #0

go get github.com/algorand/[email protected]

go mod tidy

tidy up after every go get

simplify

revert

tidier

tg

tg
  • Loading branch information
Zeph Grunschlag committed May 22, 2023
1 parent 31ae1d6 commit 75ac806
Show file tree
Hide file tree
Showing 47 changed files with 2,452 additions and 1,026 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ ARCH := $(shell ./scripts/archtype.sh)
OS_TYPE := $(shell ./scripts/ostype.sh)
S3_RELEASE_BUCKET = $$S3_RELEASE_BUCKET

GOLANG_VERSIONS := $(shell ./scripts/get_golang_version.sh all)
GOLANG_VERSION_BUILD := $(firstword $(GOLANG_VERSIONS))
GOLANG_VERSION_SUPPORT := $(lastword $(GOLANG_VERSIONS))

# If build number already set, use it - to ensure same build number across multiple platforms being built
BUILDNUMBER ?= $(shell ./scripts/compute_build_number.sh)
FULLBUILDNUMBER ?= $(shell ./scripts/compute_build_number.sh -f)
Expand Down Expand Up @@ -101,6 +105,12 @@ fix: build
lint: deps
$(GOPATH1)/bin/golangci-lint run -c .golangci.yml

tidy:
export PATH=$(GOPATH1)/bin:$(PATH) && \
go install golang.org/dl/go$(GOLANG_VERSION_BUILD)@latest && \
go$(GOLANG_VERSION_BUILD) download && \
go$(GOLANG_VERSION_BUILD) mod tidy -compat=$(GOLANG_VERSION_SUPPORT)

check_shell:
find . -type f -name "*.sh" -exec shellcheck {} +

Expand Down
6 changes: 3 additions & 3 deletions agreement/abstractions.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ type LedgerReader interface {
// protocol may lose liveness.
LookupAgreement(basics.Round, basics.Address) (basics.OnlineAccountData, error)

// Circulation returns the total amount of money in circulation at the
// conclusion of a given round.
// Circulation returns the total amount of online money in circulation at the
// conclusion of a given round rnd that is eligible for voting at voteRnd.
//
// This method returns an error if the given Round has not yet been
// confirmed. It may also return an error if the given Round is
// unavailable by the storage device. In that case, the agreement
// protocol may lose liveness.
Circulation(basics.Round) (basics.MicroAlgos, error)
Circulation(rnd basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error)

// LookupDigest returns the Digest of the entry that was agreed on in a
// given round.
Expand Down
2 changes: 1 addition & 1 deletion agreement/agreementtest/simulate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (l *testLedger) LookupAgreement(r basics.Round, a basics.Address) (basics.O
return l.state[a].OnlineAccountData(), nil
}

func (l *testLedger) Circulation(r basics.Round) (basics.MicroAlgos, error) {
func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error) {
l.mu.Lock()
defer l.mu.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion agreement/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (l *testLedger) LookupAgreement(r basics.Round, a basics.Address) (basics.O
return l.state[a].OnlineAccountData(), nil
}

func (l *testLedger) Circulation(r basics.Round) (basics.MicroAlgos, error) {
func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error) {
l.mu.Lock()
defer l.mu.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion agreement/demux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (t *demuxTester) LookupAgreement(basics.Round, basics.Address) (basics.Onli
}

// implement Ledger
func (t *demuxTester) Circulation(basics.Round) (basics.MicroAlgos, error) {
func (t *demuxTester) Circulation(basics.Round, basics.Round) (basics.MicroAlgos, error) {
// we don't care about this function in this test.
return basics.MicroAlgos{}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (l *testLedger) LookupAgreement(r basics.Round, a basics.Address) (basics.O
return l.state[a].OnlineAccountData(), nil
}

func (l *testLedger) Circulation(r basics.Round) (basics.MicroAlgos, error) {
func (l *testLedger) Circulation(r basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error) {
l.mu.Lock()
defer l.mu.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion agreement/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func membership(l LedgerReader, addr basics.Address, r basics.Round, p period, s
return
}

total, err := l.Circulation(balanceRound)
total, err := l.Circulation(balanceRound, r)
if err != nil {
err = fmt.Errorf("Service.initializeVote (r=%d): Failed to obtain total circulation in round %d: %v", r, balanceRound, err)
return
Expand Down
2 changes: 1 addition & 1 deletion catchup/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ func (m *mockedLedger) Block(r basics.Round) (bookkeeping.Block, error) {
func (m *mockedLedger) Lookup(basics.Round, basics.Address) (basics.AccountData, error) {
return basics.AccountData{}, errors.New("not needed for mockedLedger")
}
func (m *mockedLedger) Circulation(basics.Round) (basics.MicroAlgos, error) {
func (m *mockedLedger) Circulation(basics.Round, basics.Round) (basics.MicroAlgos, error) {
return basics.MicroAlgos{}, errors.New("not needed for mockedLedger")
}
func (m *mockedLedger) ConsensusVersion(basics.Round) (protocol.ConsensusVersion, error) {
Expand Down
7 changes: 7 additions & 0 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ type ConsensusParams struct {

// EnableBoxRefNameError specifies that box ref names should be validated early
EnableBoxRefNameError bool

// ExcludeExpiredCirculation excludes expired stake from the total online stake
// used by agreement for Circulation, and updates the calculation of StateProofOnlineTotalWeight used
// by state proofs to use the same method (rather than excluding stake from the top N stakeholders as before).
ExcludeExpiredCirculation bool
}

// PaysetCommitType enumerates possible ways for the block header to commit to
Expand Down Expand Up @@ -1281,6 +1286,8 @@ func initConsensusProtocols() {
vFuture.StateProofUseTrackerVerification = true
vFuture.EnableCatchpointsWithSPContexts = true

vFuture.ExcludeExpiredCirculation = true

Consensus[protocol.ConsensusFuture] = vFuture

// vAlphaX versions are an separate series of consensus parameters and versions for alphanet
Expand Down
18 changes: 13 additions & 5 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@
],
"responses": {
"200": {
"$ref": "#/responses/TransactionGroupLedgerStateDeltaForRoundResponse"
"$ref": "#/responses/TransactionGroupLedgerStateDeltasForRoundResponse"
},
"401": {
"description": "Invalid API Token",
Expand Down Expand Up @@ -4040,12 +4040,20 @@
"$ref": "#/definitions/LedgerStateDelta"
}
},
"TransactionGroupLedgerStateDeltaForRoundResponse": {
"TransactionGroupLedgerStateDeltasForRoundResponse": {
"description": "Response containing all ledger state deltas for transaction groups, with their associated Ids, in a single round.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/LedgerStateDeltaForTransactionGroup"
"type": "object",
"required": [
"deltas"
],
"properties": {
"deltas": {
"type": "array",
"items": {
"$ref": "#/definitions/LedgerStateDeltaForTransactionGroup"
}
}
}
}
},
Expand Down
44 changes: 34 additions & 10 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -857,14 +857,22 @@
},
"description": "Supply represents the current supply of MicroAlgos in the system."
},
"TransactionGroupLedgerStateDeltaForRoundResponse": {
"TransactionGroupLedgerStateDeltasForRoundResponse": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup"
"properties": {
"deltas": {
"items": {
"$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup"
},
"type": "array"
}
},
"type": "array"
"required": [
"deltas"
],
"type": "object"
}
}
},
Expand Down Expand Up @@ -4143,18 +4151,34 @@
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup"
"properties": {
"deltas": {
"items": {
"$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup"
},
"type": "array"
}
},
"type": "array"
"required": [
"deltas"
],
"type": "object"
}
},
"application/msgpack": {
"schema": {
"items": {
"$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup"
"properties": {
"deltas": {
"items": {
"$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup"
},
"type": "array"
}
},
"type": "array"
"required": [
"deltas"
],
"type": "object"
}
}
},
Expand Down
Loading

0 comments on commit 75ac806

Please sign in to comment.