Skip to content

Commit 42ed2f5

Browse files
Merge branch 'release/v2.7.0'
2 parents 84b6058 + a601e49 commit 42ed2f5

40 files changed

+541
-102
lines changed

.circleci/config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
go: circleci/go@1.11.0
4+
go: circleci/go@1.12.0
55

66
workflows:
77
circleci_build_and_test:
@@ -10,12 +10,12 @@ workflows:
1010
name: 'test_go_<< matrix.go_version >>'
1111
matrix:
1212
parameters:
13-
go_version: ['1.21.10']
13+
go_version: ['1.23.3']
1414

1515
jobs:
1616
test:
1717
machine:
18-
image: "ubuntu-2204:2022.04.2"
18+
image: "ubuntu-2404:2024.05.1"
1919
parameters:
2020
go_version:
2121
type: string
@@ -25,5 +25,4 @@ jobs:
2525
version: << parameters.go_version >>
2626
- run: |
2727
go version
28-
go get -u golang.org/x/lint/golint
2928
make docker-test

.github/workflows/codegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out repository
13-
uses: actions/checkout@v3.5.3
13+
uses: actions/checkout@v4
1414
- name: Generate and PR
1515
uses: algorand/generator/.github/actions/sdk-codegen/@master
1616
with:

.github/workflows/create-release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fi
4444
4545
- name: Checkout
46-
uses: actions/checkout@v3.5.3
46+
uses: actions/checkout@v4
4747
with:
4848
fetch-depth: 0
4949

@@ -159,7 +159,7 @@ jobs:
159159
160160
- name: Send Slack Message
161161
id: slack
162-
uses: slackapi/slack-github-action@v1.24.0
162+
uses: slackapi/slack-github-action@v1.27.0
163163
env:
164164
RELEASE_TAG: ${{ steps.set-release.outputs.release-tag }}
165165
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/pr-type-category.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Check PR Category and Type
1111
steps:
1212
- name: Checking for correct number of required github pr labels
13-
uses: mheap/github-action-required-labels@v2
13+
uses: mheap/github-action-required-labels@v5
1414
with:
1515
mode: exactly
1616
count: 1

.github/workflows/reviewdog.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Check out code into the Go module directory
9-
uses: actions/checkout@v3.5.3
9+
uses: actions/checkout@v4
1010
with:
1111
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
1212
- name: Install specific golang
13-
uses: actions/setup-go@v4.0.1
13+
uses: actions/setup-go@v5
1414
with:
15-
go-version: '1.21.10'
15+
go-version: '1.23.3'
1616
- name: Check format
1717
run: test -z `go fmt ./...`
1818
- name: Vet
1919
run: go vet ./...
2020
- name: reviewdog-golangci-lint
21-
uses: reviewdog/action-golangci-lint@v2.6.1
21+
uses: reviewdog/action-golangci-lint@v2.6.2
2222
with:
23-
golangci_lint_version: "v1.58.0"
23+
golangci_lint_version: "v1.62.0"
2424
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
25-
go_version: "1.21.10"
25+
go_version: "1.23.3"
2626
reporter: "github-pr-review"
2727
tool_name: "Lint Errors"
2828
level: "error"

.golangci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
run:
22
timeout: 5m
33
tests: false
4-
skip-dirs:
5-
# Don't run linter on generated files
6-
- client/v2
74

85
linters:
96
disable-all: true
107
enable:
118
- errcheck
12-
- exportloopref
9+
- copyloopvar
1310
- gci
1411
- gofmt
1512
- gosimple
@@ -66,7 +63,11 @@ issues:
6663
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
6764
# "EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore"
6865
- ineffective break statement. Did you mean to break out of the outer loop
69-
66+
67+
exclude-dirs:
68+
# Don't run linter on generated files
69+
- client/v2
70+
7071
exclude-rules:
7172
# Test utilities and helpers may have code that look unused, but is being used in another file
7273
- path: test/helpers.go

.test-env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configs for testing repo download:
22
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing"
3-
SDK_TESTING_BRANCH="V2"
3+
SDK_TESTING_BRANCH="master"
44
SDK_TESTING_HARNESS="test-harness"
55

66
INSTALL_ONLY=0

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# v2.7.0
2+
3+
<!-- Release notes generated using configuration in .github/release.yml at release/v2.7.0 -->
4+
5+
## What's Changed
6+
### New Features
7+
* Build: Bump golang version to 1.23.3 by @gmalouf in https://github.com/algorand/go-algorand-sdk/pull/662
8+
### Enhancements
9+
* 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
10+
* 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
11+
* Simulate: Support `FixSigners` option by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/647
12+
* Build: Update ubuntu image and remove unversioned golint download. by @gmalouf in https://github.com/algorand/go-algorand-sdk/pull/658
13+
* API: Regenerate code with the latest specification file (619d56d8) by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/657
14+
* protocol: Add EnableLogicSigSizePooling consensus variable by @giuliop in https://github.com/algorand/go-algorand-sdk/pull/659
15+
* Incentives: Updates for new heartbeat transaction type and latest consensus v40 by @gmalouf in https://github.com/algorand/go-algorand-sdk/pull/661
16+
### Other
17+
* Regenerate code with the latest specification file (548ee6a8) by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/670
18+
* Regenerate code with the latest specification file (38cee6a8) by @github-actions in https://github.com/algorand/go-algorand-sdk/pull/671
19+
20+
## New Contributors
21+
* @dependabot made their first contribution in https://github.com/algorand/go-algorand-sdk/pull/605
22+
* @giuliop made their first contribution in https://github.com/algorand/go-algorand-sdk/pull/659
23+
24+
**Full Changelog**: https://github.com/algorand/go-algorand-sdk/compare/v2.6.0...v2.7.0
25+
126
# v2.6.0
227

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

CODEOWNERS

Lines changed: 0 additions & 2 deletions
This file was deleted.

client/v2/algod/accountInformation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type AccountInformationParams struct {
2222
}
2323

2424
// AccountInformation given a specific account public key, this call returns the
25-
// accounts status, balance and spendable amounts
25+
// account's status, balance and spendable amounts
2626
type AccountInformation struct {
2727
c *Client
2828

client/v2/algod/algod.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ func (c *Client) GetBlockHash(round uint64) *GetBlockHash {
106106
return &GetBlockHash{c: c, round: round}
107107
}
108108

109+
func (c *Client) GetBlockHeader(round uint64) *GetBlockHeader {
110+
return &GetBlockHeader{c: c, round: round}
111+
}
112+
109113
func (c *Client) GetTransactionProof(round uint64, txid string) *GetTransactionProof {
110114
return &GetTransactionProof{c: c, round: round, txid: txid}
111115
}

client/v2/algod/getBlockHeader.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package algod
2+
3+
import (
4+
"context"
5+
"fmt"
6+
7+
"github.com/algorand/go-algorand-sdk/v2/client/v2/common"
8+
"github.com/algorand/go-algorand-sdk/v2/client/v2/common/models"
9+
)
10+
11+
// GetBlockHeaderParams contains all of the query parameters for url serialization.
12+
type GetBlockHeaderParams struct {
13+
14+
// Format configures whether the response object is JSON or MessagePack encoded. If
15+
// not provided, defaults to JSON.
16+
Format string `url:"format,omitempty"`
17+
}
18+
19+
// GetBlockHeader get the block header for the block on the given round.
20+
type GetBlockHeader struct {
21+
c *Client
22+
23+
round uint64
24+
25+
p GetBlockHeaderParams
26+
}
27+
28+
// Do performs the HTTP request
29+
func (s *GetBlockHeader) Do(ctx context.Context, headers ...*common.Header) (response models.BlockHeaderResponse, err error) {
30+
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/blocks/%s/header", common.EscapeParams(s.round)...), s.p, headers)
31+
return
32+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package models
2+
3+
import "github.com/algorand/go-algorand-sdk/v2/types"
4+
5+
// BlockHeaderResponse block header.
6+
type BlockHeaderResponse struct {
7+
// Blockheader block header data.
8+
Blockheader types.Block `json:"blockHeader"`
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package models
2+
3+
// BlockHeadersResponse
4+
type BlockHeadersResponse struct {
5+
// Blocks
6+
Blocks []Block `json:"blocks"`
7+
8+
// CurrentRound round at which the results were computed.
9+
CurrentRound uint64 `json:"current-round"`
10+
11+
// NextToken used for pagination, when making another request provide this token
12+
// with the next parameter.
13+
NextToken string `json:"next-token,omitempty"`
14+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package models
2+
3+
// HbProofFields (hbprf) HbProof is a signature using HeartbeatAddress's partkey,
4+
// thereby showing it is online.
5+
type HbProofFields struct {
6+
// HbPk (p) Public key of the heartbeat message.
7+
HbPk []byte `json:"hb-pk,omitempty"`
8+
9+
// HbPk1sig (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset)
10+
// under the key PK2.
11+
HbPk1sig []byte `json:"hb-pk1sig,omitempty"`
12+
13+
// HbPk2 (p2) Key for new-style two-level ephemeral signature.
14+
HbPk2 []byte `json:"hb-pk2,omitempty"`
15+
16+
// HbPk2sig (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the
17+
// master key (OneTimeSignatureVerifier).
18+
HbPk2sig []byte `json:"hb-pk2sig,omitempty"`
19+
20+
// HbSig (s) Signature of the heartbeat message.
21+
HbSig []byte `json:"hb-sig,omitempty"`
22+
}

client/v2/common/models/simulate_request.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ type SimulateRequest struct {
1919
// transaction group.
2020
ExtraOpcodeBudget uint64 `json:"extra-opcode-budget,omitempty"`
2121

22+
// FixSigners if true, signers for transactions that are missing signatures will be
23+
// fixed during evaluation.
24+
FixSigners bool `json:"fix-signers,omitempty"`
25+
2226
// Round if provided, specifies the round preceding the simulation. State changes
2327
// through this round will be used to run this simulation. Usually only the 4 most
2428
// recent rounds will be available (controlled by the node config value

client/v2/common/models/simulate_transaction_result.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ type SimulateTransactionResult struct {
1010
// inner app call trace in a recursive way.
1111
ExecTrace SimulationTransactionExecTrace `json:"exec-trace,omitempty"`
1212

13+
// FixedSigner the account that needed to sign this transaction when no signature
14+
// was provided and the provided signer was incorrect.
15+
FixedSigner string `json:"fixed-signer,omitempty"`
16+
1317
// LogicSigBudgetConsumed budget used during execution of a logic sig transaction.
1418
LogicSigBudgetConsumed uint64 `json:"logic-sig-budget-consumed,omitempty"`
1519

client/v2/common/models/simulation_eval_overrides.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ type SimulationEvalOverrides struct {
1616
// simulation
1717
ExtraOpcodeBudget uint64 `json:"extra-opcode-budget,omitempty"`
1818

19+
// FixSigners if true, signers for transactions that are missing signatures will be
20+
// fixed during evaluation.
21+
FixSigners bool `json:"fix-signers,omitempty"`
22+
1923
// MaxLogCalls the maximum log calls one can make during simulation
2024
MaxLogCalls uint64 `json:"max-log-calls,omitempty"`
2125

client/v2/common/models/transaction.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ type Transaction struct {
7373
// the sha512/256 hash of the transactions in that group.
7474
Group []byte `json:"group,omitempty"`
7575

76+
// HeartbeatTransaction fields for a heartbeat transaction.
77+
// Definition:
78+
// data/transactions/heartbeat.go : HeartbeatTxnFields
79+
HeartbeatTransaction TransactionHeartbeat `json:"heartbeat-transaction,omitempty"`
80+
7681
// Id transaction ID
7782
Id string `json:"id,omitempty"`
7883

@@ -148,5 +153,6 @@ type Transaction struct {
148153
// * (afrz) asset-freeze-transaction
149154
// * (appl) application-transaction
150155
// * (stpf) state-proof-transaction
156+
// * (hb) heartbeat-transaction
151157
Type string `json:"tx-type,omitempty"`
152158
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package models
2+
3+
// TransactionHeartbeat fields for a heartbeat transaction.
4+
// Definition:
5+
// data/transactions/heartbeat.go : HeartbeatTxnFields
6+
type TransactionHeartbeat struct {
7+
// HbAddress (hbad) HbAddress is the account this txn is proving onlineness for.
8+
HbAddress string `json:"hb-address"`
9+
10+
// HbKeyDilution (hbkd) HbKeyDilution must match HbAddress account's current
11+
// KeyDilution.
12+
HbKeyDilution uint64 `json:"hb-key-dilution"`
13+
14+
// HbProof (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby
15+
// showing it is online.
16+
HbProof HbProofFields `json:"hb-proof"`
17+
18+
// HbSeed (hbsd) HbSeed must be the block seed for the this transaction's
19+
// firstValid block.
20+
HbSeed []byte `json:"hb-seed"`
21+
22+
// HbVoteId (hbvid) HbVoteID must match the HbAddress account's current VoteID.
23+
HbVoteId []byte `json:"hb-vote-id"`
24+
}

client/v2/indexer/indexer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ func (c *Client) LookupAssetTransactions(assetId uint64) *LookupAssetTransaction
129129
return &LookupAssetTransactions{c: c, assetId: assetId}
130130
}
131131

132+
func (c *Client) SearchForBlockHeaders() *SearchForBlockHeaders {
133+
return &SearchForBlockHeaders{c: c}
134+
}
135+
132136
func (c *Client) LookupBlock(roundNumber uint64) *LookupBlock {
133137
return &LookupBlock{c: c, roundNumber: roundNumber}
134138
}

client/v2/indexer/lookupAccountByID.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ type LookupAccountByIDParams struct {
2121
// localstates.
2222
IncludeAll bool `url:"include-all,omitempty"`
2323

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

@@ -52,7 +53,8 @@ func (s *LookupAccountByID) IncludeAll(IncludeAll bool) *LookupAccountByID {
5253
return s
5354
}
5455

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

0 commit comments

Comments
 (0)