Skip to content

Commit

Permalink
Merge branch 'release/v2.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Algo-devops-service committed Dec 21, 2024
2 parents 84b6058 + a601e49 commit 42ed2f5
Show file tree
Hide file tree
Showing 40 changed files with 541 additions and 102 deletions.
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
go: circleci/go@1.11.0
go: circleci/go@1.12.0

workflows:
circleci_build_and_test:
Expand All @@ -10,12 +10,12 @@ workflows:
name: 'test_go_<< matrix.go_version >>'
matrix:
parameters:
go_version: ['1.21.10']
go_version: ['1.23.3']

jobs:
test:
machine:
image: "ubuntu-2204:2022.04.2"
image: "ubuntu-2404:2024.05.1"
parameters:
go_version:
type: string
Expand All @@ -25,5 +25,4 @@ jobs:
version: << parameters.go_version >>
- run: |
go version
go get -u golang.org/x/lint/golint
make docker-test
2 changes: 1 addition & 1 deletion .github/workflows/codegen.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 repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
- name: Generate and PR
uses: algorand/generator/.github/actions/sdk-codegen/@master
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
- name: Send Slack Message
id: slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.27.0
env:
RELEASE_TAG: ${{ steps.set-release.outputs.release-tag }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-type-category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check PR Category and Type
steps:
- name: Checking for correct number of required github pr labels
uses: mheap/github-action-required-labels@v2
uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ 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
- name: Install specific golang
uses: actions/setup-go@v4.0.1
uses: actions/setup-go@v5
with:
go-version: '1.21.10'
go-version: '1.23.3'
- name: Check format
run: test -z `go fmt ./...`
- name: Vet
run: go vet ./...
- name: reviewdog-golangci-lint
uses: reviewdog/[email protected].1
uses: reviewdog/[email protected].2
with:
golangci_lint_version: "v1.58.0"
golangci_lint_version: "v1.62.0"
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
go_version: "1.21.10"
go_version: "1.23.3"
reporter: "github-pr-review"
tool_name: "Lint Errors"
level: "error"
Expand Down
11 changes: 6 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
run:
timeout: 5m
tests: false
skip-dirs:
# Don't run linter on generated files
- client/v2

linters:
disable-all: true
enable:
- errcheck
- exportloopref
- copyloopvar
- gci
- gofmt
- gosimple
Expand Down Expand Up @@ -66,7 +63,11 @@ issues:
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
# "EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore"
- ineffective break statement. Did you mean to break out of the outer loop


exclude-dirs:
# Don't run linter on generated files
- client/v2

exclude-rules:
# Test utilities and helpers may have code that look unused, but is being used in another file
- path: test/helpers.go
Expand Down
2 changes: 1 addition & 1 deletion .test-env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configs for testing repo download:
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing"
SDK_TESTING_BRANCH="V2"
SDK_TESTING_BRANCH="master"
SDK_TESTING_HARNESS="test-harness"

INSTALL_ONLY=0
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# v2.7.0

<!-- Release notes generated using configuration in .github/release.yml at release/v2.7.0 -->

## What's Changed
### New Features
* Build: Bump golang version to 1.23.3 by @gmalouf in https://github.com/algorand/go-algorand-sdk/pull/662
### Enhancements
* Dependencies: Bump gopkg.in/yaml.v3 from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0 by @dependabot in https://github.com/algorand/go-algorand-sdk/pull/605
* Dependencies: build(deps): bump golang.org/x/crypto from 0.0.0-20210921155107-089bfa567519 to 0.17.0 by @dependabot in https://github.com/algorand/go-algorand-sdk/pull/646
* Simulate: Support `FixSigners` option by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/647
* Build: Update ubuntu image and remove unversioned golint download. by @gmalouf in https://github.com/algorand/go-algorand-sdk/pull/658
* API: Regenerate code with the latest specification file (619d56d8) by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/657
* protocol: Add EnableLogicSigSizePooling consensus variable by @giuliop in https://github.com/algorand/go-algorand-sdk/pull/659
* Incentives: Updates for new heartbeat transaction type and latest consensus v40 by @gmalouf in https://github.com/algorand/go-algorand-sdk/pull/661
### Other
* Regenerate code with the latest specification file (548ee6a8) by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/670
* Regenerate code with the latest specification file (38cee6a8) by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/671

## New Contributors
* @dependabot made their first contribution in https://github.com/algorand/go-algorand-sdk/pull/605
* @giuliop made their first contribution in https://github.com/algorand/go-algorand-sdk/pull/659

**Full Changelog**: https://github.com/algorand/go-algorand-sdk/compare/v2.6.0...v2.7.0

# v2.6.0

<!-- Release notes generated using configuration in .github/release.yml at release/v2.6.0 -->
Expand Down
2 changes: 0 additions & 2 deletions CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion client/v2/algod/accountInformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type AccountInformationParams struct {
}

// AccountInformation given a specific account public key, this call returns the
// accounts status, balance and spendable amounts
// account's status, balance and spendable amounts
type AccountInformation struct {
c *Client

Expand Down
4 changes: 4 additions & 0 deletions client/v2/algod/algod.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func (c *Client) GetBlockHash(round uint64) *GetBlockHash {
return &GetBlockHash{c: c, round: round}
}

func (c *Client) GetBlockHeader(round uint64) *GetBlockHeader {
return &GetBlockHeader{c: c, round: round}
}

func (c *Client) GetTransactionProof(round uint64, txid string) *GetTransactionProof {
return &GetTransactionProof{c: c, round: round, txid: txid}
}
Expand Down
32 changes: 32 additions & 0 deletions client/v2/algod/getBlockHeader.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package algod

import (
"context"
"fmt"

"github.com/algorand/go-algorand-sdk/v2/client/v2/common"
"github.com/algorand/go-algorand-sdk/v2/client/v2/common/models"
)

// GetBlockHeaderParams contains all of the query parameters for url serialization.
type GetBlockHeaderParams struct {

// Format configures whether the response object is JSON or MessagePack encoded. If
// not provided, defaults to JSON.
Format string `url:"format,omitempty"`
}

// GetBlockHeader get the block header for the block on the given round.
type GetBlockHeader struct {
c *Client

round uint64

p GetBlockHeaderParams
}

// Do performs the HTTP request
func (s *GetBlockHeader) Do(ctx context.Context, headers ...*common.Header) (response models.BlockHeaderResponse, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/blocks/%s/header", common.EscapeParams(s.round)...), s.p, headers)
return
}
9 changes: 9 additions & 0 deletions client/v2/common/models/block_header_response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package models

import "github.com/algorand/go-algorand-sdk/v2/types"

// BlockHeaderResponse block header.
type BlockHeaderResponse struct {
// Blockheader block header data.
Blockheader types.Block `json:"blockHeader"`
}
14 changes: 14 additions & 0 deletions client/v2/common/models/block_headers_response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package models

// BlockHeadersResponse
type BlockHeadersResponse struct {
// Blocks
Blocks []Block `json:"blocks"`

// CurrentRound round at which the results were computed.
CurrentRound uint64 `json:"current-round"`

// NextToken used for pagination, when making another request provide this token
// with the next parameter.
NextToken string `json:"next-token,omitempty"`
}
22 changes: 22 additions & 0 deletions client/v2/common/models/hb_proof_fields.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package models

// HbProofFields (hbprf) HbProof is a signature using HeartbeatAddress's partkey,
// thereby showing it is online.
type HbProofFields struct {
// HbPk (p) Public key of the heartbeat message.
HbPk []byte `json:"hb-pk,omitempty"`

// HbPk1sig (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset)
// under the key PK2.
HbPk1sig []byte `json:"hb-pk1sig,omitempty"`

// HbPk2 (p2) Key for new-style two-level ephemeral signature.
HbPk2 []byte `json:"hb-pk2,omitempty"`

// HbPk2sig (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the
// master key (OneTimeSignatureVerifier).
HbPk2sig []byte `json:"hb-pk2sig,omitempty"`

// HbSig (s) Signature of the heartbeat message.
HbSig []byte `json:"hb-sig,omitempty"`
}
4 changes: 4 additions & 0 deletions client/v2/common/models/simulate_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ type SimulateRequest struct {
// transaction group.
ExtraOpcodeBudget uint64 `json:"extra-opcode-budget,omitempty"`

// FixSigners if true, signers for transactions that are missing signatures will be
// fixed during evaluation.
FixSigners bool `json:"fix-signers,omitempty"`

// Round if provided, specifies the round preceding the simulation. State changes
// through this round will be used to run this simulation. Usually only the 4 most
// recent rounds will be available (controlled by the node config value
Expand Down
4 changes: 4 additions & 0 deletions client/v2/common/models/simulate_transaction_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ type SimulateTransactionResult struct {
// inner app call trace in a recursive way.
ExecTrace SimulationTransactionExecTrace `json:"exec-trace,omitempty"`

// FixedSigner the account that needed to sign this transaction when no signature
// was provided and the provided signer was incorrect.
FixedSigner string `json:"fixed-signer,omitempty"`

// LogicSigBudgetConsumed budget used during execution of a logic sig transaction.
LogicSigBudgetConsumed uint64 `json:"logic-sig-budget-consumed,omitempty"`

Expand Down
4 changes: 4 additions & 0 deletions client/v2/common/models/simulation_eval_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type SimulationEvalOverrides struct {
// simulation
ExtraOpcodeBudget uint64 `json:"extra-opcode-budget,omitempty"`

// FixSigners if true, signers for transactions that are missing signatures will be
// fixed during evaluation.
FixSigners bool `json:"fix-signers,omitempty"`

// MaxLogCalls the maximum log calls one can make during simulation
MaxLogCalls uint64 `json:"max-log-calls,omitempty"`

Expand Down
6 changes: 6 additions & 0 deletions client/v2/common/models/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ type Transaction struct {
// the sha512/256 hash of the transactions in that group.
Group []byte `json:"group,omitempty"`

// HeartbeatTransaction fields for a heartbeat transaction.
// Definition:
// data/transactions/heartbeat.go : HeartbeatTxnFields
HeartbeatTransaction TransactionHeartbeat `json:"heartbeat-transaction,omitempty"`

// Id transaction ID
Id string `json:"id,omitempty"`

Expand Down Expand Up @@ -148,5 +153,6 @@ type Transaction struct {
// * (afrz) asset-freeze-transaction
// * (appl) application-transaction
// * (stpf) state-proof-transaction
// * (hb) heartbeat-transaction
Type string `json:"tx-type,omitempty"`
}
24 changes: 24 additions & 0 deletions client/v2/common/models/transaction_heartbeat.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package models

// TransactionHeartbeat fields for a heartbeat transaction.
// Definition:
// data/transactions/heartbeat.go : HeartbeatTxnFields
type TransactionHeartbeat struct {
// HbAddress (hbad) HbAddress is the account this txn is proving onlineness for.
HbAddress string `json:"hb-address"`

// HbKeyDilution (hbkd) HbKeyDilution must match HbAddress account's current
// KeyDilution.
HbKeyDilution uint64 `json:"hb-key-dilution"`

// HbProof (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby
// showing it is online.
HbProof HbProofFields `json:"hb-proof"`

// HbSeed (hbsd) HbSeed must be the block seed for the this transaction's
// firstValid block.
HbSeed []byte `json:"hb-seed"`

// HbVoteId (hbvid) HbVoteID must match the HbAddress account's current VoteID.
HbVoteId []byte `json:"hb-vote-id"`
}
4 changes: 4 additions & 0 deletions client/v2/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func (c *Client) LookupAssetTransactions(assetId uint64) *LookupAssetTransaction
return &LookupAssetTransactions{c: c, assetId: assetId}
}

func (c *Client) SearchForBlockHeaders() *SearchForBlockHeaders {
return &SearchForBlockHeaders{c: c}
}

func (c *Client) LookupBlock(roundNumber uint64) *LookupBlock {
return &LookupBlock{c: c, roundNumber: roundNumber}
}
Expand Down
6 changes: 4 additions & 2 deletions client/v2/indexer/lookupAccountByID.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ type LookupAccountByIDParams struct {
// localstates.
IncludeAll bool `url:"include-all,omitempty"`

// Round include results for the specified round.
// Round deprecated and disallowed. This parameter used to include results for a
// specified round. Requests with this parameter set are now rejected.
Round uint64 `url:"round,omitempty"`
}

Expand Down Expand Up @@ -52,7 +53,8 @@ func (s *LookupAccountByID) IncludeAll(IncludeAll bool) *LookupAccountByID {
return s
}

// Round include results for the specified round.
// Round deprecated and disallowed. This parameter used to include results for a
// specified round. Requests with this parameter set are now rejected.
func (s *LookupAccountByID) Round(Round uint64) *LookupAccountByID {
s.p.Round = Round

Expand Down
Loading

0 comments on commit 42ed2f5

Please sign in to comment.