Skip to content

Commit

Permalink
Merge pull request #6029 from Algo-devops-service/relstable3.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
algojohnlee authored Jun 13, 2024
2 parents 5c2cf06 + 6b09750 commit 9855f57
Show file tree
Hide file tree
Showing 82 changed files with 3,351 additions and 2,801 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ jobs:
parameters:
platform:
type: string
executor: << parameters.platform >>_medium
executor: << parameters.platform >>_large
working_directory: << pipeline.parameters.build_dir >>/project
parallelism: 10
environment:
Expand All @@ -319,7 +319,7 @@ jobs:
parameters:
platform:
type: string
executor: << parameters.platform >>_medium
executor: << parameters.platform >>_large
working_directory: << pipeline.parameters.build_dir >>/project
parallelism: 2
environment:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
go-version-file: 'go.mod'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
update: true
path-type: inherit
- name: Check out code
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine Go version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- 8080:8080
steps:
- name: Check out code
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0
path: go-algorand
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4

- name: Generate Container Metadata
id: meta
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
# if: github.ref == format('refs/heads/{0}', 'master')
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3.5.3
# uses: actions/checkout@v4

# - name: Update DockerHub Repository Description
# uses: peter-evans/dockerhub-description@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
# move go out of the way temporarily to avoid "go list ./..." from installing modules
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
# move go out of the way temporarily to avoid "go list ./..." from installing modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
# move go out of the way temporarily to avoid "go list ./..." from installing modules
- name: Make libsodium.a
run: sudo mv /usr/bin/go /usr/bin/go.bak && make crypto/libs/linux/amd64/lib/libsodium.a && sudo mv /usr/bin/go.bak /usr/bin/go
Expand Down
2 changes: 0 additions & 2 deletions CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion agreement/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func verifyProposer(p unauthenticatedProposal, ledger LedgerReader) error {
// the header lacks it, the returned balanceRecord will be the right record.
func payoutEligible(rnd basics.Round, proposer basics.Address, ledger LedgerReader, cparams config.ConsensusParams) (bool, basics.OnlineAccountData, error) {
// Check the balance from the agreement round
balanceRound := balanceRound(rnd, cparams)
balanceRound := BalanceRound(rnd, cparams)
balanceRecord, err := ledger.LookupAgreement(balanceRound, proposer)
if err != nil {
return false, basics.OnlineAccountData{}, err
Expand Down
2 changes: 1 addition & 1 deletion agreement/proposalManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (m *proposalManager) handleMessageEvent(r routerHandle, p player, e filtera
}
}

// filterVote filters a vote, checking if it is both fresh and not a duplicate, returning
// filterProposalVote filters a vote, checking if it is both fresh and not a duplicate, returning
// an errProposalManagerPVNotFresh or errProposalManagerPVDuplicate if so, else nil.
// It also returns a bool indicating whether this proposal-vote should still be verified for tracking credential history.
func (m *proposalManager) filterProposalVote(p player, r routerHandle, uv unauthenticatedVote, freshData freshnessData) (bool, error) {
Expand Down
7 changes: 6 additions & 1 deletion agreement/pseudonode.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (n *asyncPseudonode) loadRoundParticipationKeys(voteRound basics.Round) []a
n.participationKeys = nil
return nil
}
balanceRound := balanceRound(voteRound, cparams)
balanceRound := BalanceRound(voteRound, cparams)

// measure the time it takes to acquire the voting keys.
beforeVotingKeysTime := time.Now()
Expand Down Expand Up @@ -422,6 +422,9 @@ func (t pseudonodeVotesTask) execute(verifier *AsyncVoteVerifier, quit chan stru
Type: logspec.VoteBroadcast,
Sender: vote.R.Sender.String(),
Hash: vote.R.Proposal.BlockDigest.String(),
Round: uint64(t.round),
Period: uint64(t.period),
Step: uint64(t.step),
ObjectRound: uint64(vote.R.Round),
ObjectPeriod: uint64(vote.R.Period),
ObjectStep: uint64(vote.R.Step),
Expand Down Expand Up @@ -549,6 +552,8 @@ func (t pseudonodeProposalsTask) execute(verifier *AsyncVoteVerifier, quit chan
logEvent := logspec.AgreementEvent{
Type: logspec.ProposalBroadcast,
Hash: vote.R.Proposal.BlockDigest.String(),
Round: uint64(t.round),
Period: uint64(t.period),
ObjectRound: uint64(vote.R.Round),
ObjectPeriod: uint64(vote.R.Period),
}
Expand Down
2 changes: 1 addition & 1 deletion agreement/pseudonode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func TestPseudonodeLoadingOfParticipationKeys(t *testing.T) {
for rnd := basics.Round(3); rnd < 1000; rnd += 43 {
keyManagerProxy.target = func(votingRound, balanceRnd basics.Round) []account.ParticipationRecordForRound {
require.Equal(t, rnd, votingRound)
require.Equal(t, balanceRound(rnd, cparams), balanceRnd)
require.Equal(t, BalanceRound(rnd, cparams), balanceRnd)
return keyManager.VotingKeys(votingRound, balanceRnd)
}
pb.loadRoundParticipationKeys(basics.Round(rnd))
Expand Down
7 changes: 5 additions & 2 deletions agreement/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ func (sel selector) CommitteeSize(proto config.ConsensusParams) uint64 {
return sel.Step.committeeSize(proto)
}

func balanceRound(r basics.Round, cparams config.ConsensusParams) basics.Round {
// BalanceRound returns the round that should be considered by agreement when
// looking at online stake (and status and key material). It is exported so that
// AVM can provide opcodes that return the same data.
func BalanceRound(r basics.Round, cparams config.ConsensusParams) basics.Round {
return r.SubSaturate(basics.Round(2 * cparams.SeedRefreshInterval * cparams.SeedLookback))
}

Expand All @@ -61,7 +64,7 @@ func membership(l LedgerReader, addr basics.Address, r basics.Round, p period, s
if err != nil {
return
}
balanceRound := balanceRound(r, cparams)
balanceRound := BalanceRound(r, cparams)
seedRound := seedRound(r, cparams)

record, err := l.LookupAgreement(balanceRound, addr)
Expand Down
2 changes: 1 addition & 1 deletion catchup/catchpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ func (cs *CatchpointCatchupService) fetchBlock(round basics.Round, retryCount ui
return blk, cert, downloadDuration, psp, false, nil
}

// processStageLedgerDownload is the fifth catchpoint catchup stage. It completes the catchup process, swap the new tables and restart the node functionality.
// processStageSwitch is the fifth catchpoint catchup stage. It completes the catchup process, swap the new tables and restart the node functionality.
func (cs *CatchpointCatchupService) processStageSwitch() (err error) {
err = cs.ledgerAccessor.CompleteCatchup(cs.ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion catchup/universalFetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type universalBlockFetcher struct {
log logging.Logger
}

// makeUniversalFetcher returns a fetcher for http and ws peers.
// makeUniversalBlockFetcher returns a fetcher for http and ws peers.
func makeUniversalBlockFetcher(log logging.Logger, net network.GossipNode, config config.Local) *universalBlockFetcher {
return &universalBlockFetcher{
config: config,
Expand Down
2 changes: 1 addition & 1 deletion cmd/goal/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ const maxAppArgs = 16
// minus 1 for the final app argument becoming a tuple of the remaining method args
const methodArgsTupleThreshold = maxAppArgs - 2

// parseArgJSONtoByteSlice convert input method arguments to ABI encoded bytes
// parseMethodArgJSONtoByteSlice convert input method arguments to ABI encoded bytes
// it converts funcArgTypes into a tuple type and apply changes over input argument string (in JSON format)
// if there are greater or equal to 15 inputs, then we compact the tailing inputs into one tuple
func parseMethodArgJSONtoByteSlice(argTypes []string, jsonArgs []string, applicationArgs *[][]byte) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/netgoal/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ func runBuildNetwork() error {
return fmt.Errorf("error resolving bootstrap file: %v", err)
}
net.BootstrappedNet = fileTemplate
net.SetUseBoostrappedFiles(bootstrapLoadingFile)
net.SetUseBootstrappedFiles(bootstrapLoadingFile)
} else {
net.SetUseBoostrappedFiles(false)
net.SetUseBootstrappedFiles(false)
}

net.SetUseExistingGenesisFiles(networkUseGenesisFiles)
Expand Down
28 changes: 28 additions & 0 deletions cmd/tealdbg/localLedger.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,34 @@ func (l *localLedger) LookupWithoutRewards(rnd basics.Round, addr basics.Address
return ledgercore.ToAccountData(ad), rnd, nil
}

func (l *localLedger) LookupAgreement(rnd basics.Round, addr basics.Address) (basics.OnlineAccountData, error) {
// tealdbg does not understand rewards, so no pending rewards are applied.
// Further, it has no history, so we return the _current_ information,
// ignoring the `rnd` argument.
ad := l.balances[addr]
if ad.Status != basics.Online {
return basics.OnlineAccountData{}, nil
}

return basics.OnlineAccountData{
MicroAlgosWithRewards: ad.MicroAlgos,
VotingData: basics.VotingData{
VoteID: ad.VoteID,
SelectionID: ad.SelectionID,
StateProofID: ad.StateProofID,
VoteFirstValid: ad.VoteFirstValid,
VoteLastValid: ad.VoteLastValid,
VoteKeyDilution: ad.VoteKeyDilution,
},
IncentiveEligible: ad.IncentiveEligible,
}, nil
}

func (l *localLedger) OnlineCirculation(rnd basics.Round, voteRound basics.Round) (basics.MicroAlgos, error) {
// A constant is fine for tealdbg
return basics.Algos(1_000_000_000), nil // 1B
}

func (l *localLedger) GetCreatorForRound(rnd basics.Round, cidx basics.CreatableIndex, ctype basics.CreatableType) (basics.Address, bool, error) {
switch ctype {
case basics.AssetCreatable:
Expand Down
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const VersionMajor = 3

// VersionMinor is the Minor semantic version number (x.#.z) - changed when backwards-compatible features are introduced.
// Not enforced until after initial public release (x > 0).
const VersionMinor = 24
const VersionMinor = 25

// Version is the type holding our full version information.
type Version struct {
Expand Down
64 changes: 64 additions & 0 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,44 @@
}
}
},
"/debug/settings/pprof": {
"get": {
"description": "Retrieves the current settings for blocking and mutex profiles",
"tags": [
"private"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"operationId": "GetDebugSettingsProf",
"responses": {
"200": {
"$ref": "#/responses/DebugSettingsProfResponse"
}
}
},
"put": {
"description": "Enables blocking and mutex profiles, and returns the old settings",
"tags": [
"private"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"operationId": "PutDebugSettingsProf",
"responses": {
"200": {
"$ref": "#/responses/DebugSettingsProfResponse"
}
}
}
},
"/v2/accounts/{address}": {
"get": {
"description": "Given a specific account public key, this call returns the accounts status, balance and spendable amounts",
Expand Down Expand Up @@ -4053,6 +4091,26 @@
}
}
},
"DebugSettingsProf": {
"description": "algod mutex and blocking profiling state.",
"type": "object",
"title": "algod mutex and blocking profiling state.",
"tags": [
"private"
],
"properties": {
"block-rate": {
"description": "The rate of blocking events. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To turn off profiling entirely, pass rate 0.",
"example": 1000,
"type": "integer"
},
"mutex-rate": {
"description": "The rate of mutex events. On average 1/rate events are reported. To turn off profiling entirely, pass rate 0",
"example": 1000,
"type": "integer"
}
}
},
"BuildVersion": {
"tags": [
"common"
Expand Down Expand Up @@ -5500,6 +5558,12 @@
"schema": {
"$ref": "#/definitions/Version"
}
},
"DebugSettingsProfResponse": {
"description": "DebugPprof is the response to the /debug/extra/pprof endpoint",
"schema": {
"$ref": "#/definitions/DebugSettingsProf"
}
}
},
"securityDefinitions": {
Expand Down
Loading

0 comments on commit 9855f57

Please sign in to comment.