Skip to content

Commit aa02b68

Browse files
authored
Merge pull request #1954 from onetechnical/onetechnical/relbeta2.5.1
go-algorand 2.5.1-beta
2 parents 71b5895 + 35691b6 commit aa02b68

File tree

122 files changed

+4356
-2555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+4356
-2555
lines changed

.github/ISSUE_TEMPLATE/algorand-engineering-team-issue-template.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ assignees: ''
99
---
1010

1111
## Summary
12-
*Describe the problem identified or the general goal of this issue*
12+
<!-- *Describe the problem identified or the general goal of this issue* -->
1313

1414
## Scope/Requirements
15-
*What's involved in this issue? What's required to achieve the goal?*
15+
<!-- *What's involved in this issue? What's required to achieve the goal?* -->
1616

1717
## Urgency/Relative Priority
18-
*How urgent is this issue? What are the timing considerations to take into account?*
18+
<!-- *How urgent is this issue? What are the timing considerations to take into account?* -->

.github/ISSUE_TEMPLATE/bug_report.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,24 @@ assignees: ''
77

88
---
99

10-
<!--
11-
NOTE: If this issue relates to security, please use the vulnerability disclosure form here:
12-
https://www.algorand.com/resources/blog/security
13-
14-
General, developer or support questions concerning Algorand should be directed to the Algorand Forums https://forum.algorand.org/.
15-
-->
16-
1710
### Subject of the issue
18-
Describe your issue here.
11+
12+
<!-- Describe your issue here. -->
1913

2014
### Your environment
15+
16+
<!--
2117
* Software version: `algod -v`
2218
* Node status if applicable: `goal node status`
2319
* Operating System details.
2420
* In many cases log files and cadaver files are also useful to include. Since these files may be large, an Algorand developer may request them later. These files may include public addresses that you're participating with. If that is a concern please be sure to scrub that data.
21+
-->
2522

2623
### Steps to reproduce
27-
Tell us how to reproduce this issue.
24+
25+
1.
26+
2.
2827

2928
### Expected behaviour
30-
Tell us what should happen
3129

3230
### Actual behaviour
33-
Tell us what happens instead

.github/ISSUE_TEMPLATE/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: ❓ Question and Help
3+
url: https://forum.algorand.org/
4+
about: The issue tracker is not for support questions. Please join our community for help and discussion.

.github/ISSUE_TEMPLATE/feature_request.md

+6-19
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,14 @@ assignees: ''
77

88
---
99

10-
<!--
11-
NOTE: If this issue relates to security, please use the vulnerability disclosure form here:
12-
https://www.algorand.com/resources/blog/security
10+
## Is your feature request related to a problem? Please describe.
1311

14-
General, developer or support questions concerning Algorand should be directed to the Algorand Forums https://forum.algorand.org/.
15-
-->
12+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
1613

17-
<!--
18-
This project is focused on low level platform concerns. A good feature request would be related
19-
to protocol and network usage, debugging and monitoring tools, and goal commands.
14+
## Describe the solution you'd like.
2015

21-
Higher level suggestions relating to layer 2 applications (like wallet apps) are not appropriate here.
22-
-->
23-
**Is your feature request related to a problem? Please describe.**
16+
<!-- A clear and concise description of what you want to happen. -->
2417

25-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
18+
## Additional context.
2619

27-
**Describe the solution you'd like**
28-
29-
A clear and concise description of what you want to happen.
30-
31-
**Additional context**
32-
33-
Add any other context or screenshots about the feature request here.
20+
<!-- Add any other context or screenshots about the feature request here. -->

.github/ISSUE_TEMPLATE/question.md

-19
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ It is also a good idea to run tests:
1515

1616
## Summary
1717

18-
Explain the goal of this change and what problem it is solving. Format this cleanly so that it may be used for a commit message, as your changes will be squash-merged.
18+
<!-- Explain the goal of this change and what problem it is solving. Format this cleanly so that it may be used for a commit message, as your changes will be squash-merged. -->
1919

2020
## Test Plan
2121

22-
How did you test these changes? Please provide the exact scenarios you tested in as much detail as possible including commands, output and rationale.
22+
<!-- How did you test these changes? Please provide the exact scenarios you tested in as much detail as possible including commands, output and rationale. -->

SECURITY.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Vulnerability Disclosures
2+
3+
Algorand takes the security of the platform and of its users very seriously. We recognize the important role of external security researchers and developers in helping keep our community safe. As with most security reward programs, we ask that you use common sense when looking for security bugs. Vulnerabilities must be disclosed to us privately with reasonable time to respond, and avoid compromise of other users and accounts, or loss of funds that are not your own. We do not reward denial of service, spam, or social engineering vulnerabilities.
4+
5+
If you believe that you have found a security vulnerability you may disclose it here:
6+
7+
https://www.algorand.com/resources/blog/security

THANKS.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ In no particular order:
1212
- jsign
1313
- RomitKumar
1414
- jeapostrophe
15+
- aybehrouz
1516

1617
### Bug Reports
1718
- Nanyan

agreement/selector.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func seedRound(r basics.Round, cparams config.ConsensusParams) basics.Round {
5555
return r.SubSaturate(basics.Round(cparams.SeedLookback))
5656
}
5757

58-
// a helper function for obtaining memberhship verification parameters.
58+
// a helper function for obtaining membership verification parameters.
5959
func membership(l LedgerReader, addr basics.Address, r basics.Round, p period, s step) (m committee.Membership, err error) {
6060
cparams, err := l.ConsensusParams(ParamsRound(r))
6161
if err != nil {

buildnumber.dat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0
1+
1

catchup/catchpointService.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ func (cs *CatchpointCatchupService) processStageLastestBlockDownload() (err erro
407407
}
408408
return cs.abort(fmt.Errorf("processStageLastestBlockDownload failed when calling VerifyCatchpoint : %v", err))
409409
}
410-
// give a rank to the download, as the download was successfull.
410+
// give a rank to the download, as the download was successful.
411411
peerRank := cs.blocksDownloadPeerSelector.PeerDownloadDurationToRank(peer, blockDownloadDuration)
412412
cs.blocksDownloadPeerSelector.RankPeer(peer, peerRank)
413413

catchup/fetcher.go

+4-11
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,13 @@ type FetcherFactory interface {
5454
// Create a new fetcher
5555
New() Fetcher
5656
// Create a new fetcher that also fetches from backup peers over gossip network utilising given message tag
57-
NewOverGossip(requestTag protocol.Tag) Fetcher
57+
NewOverGossip() Fetcher
5858
}
5959

6060
// NetworkFetcherFactory creates network fetchers
6161
type NetworkFetcherFactory struct {
6262
net network.GossipNode
6363
peerLimit int
64-
fs *rpcs.WsFetcherService
6564
cfg *config.Local
6665

6766
log logging.Logger
@@ -78,12 +77,11 @@ func (factory NetworkFetcherFactory) makeHTTPFetcherFromPeer(log logging.Logger,
7877

7978
// MakeNetworkFetcherFactory returns a network fetcher factory, that associates fetchers with no more than peerLimit peers from the aggregator.
8079
// WSClientSource can be nil, if no network exists to create clients from (defaults to http clients)
81-
func MakeNetworkFetcherFactory(net network.GossipNode, peerLimit int, fs *rpcs.WsFetcherService, cfg *config.Local) NetworkFetcherFactory {
80+
func MakeNetworkFetcherFactory(net network.GossipNode, peerLimit int, cfg *config.Local) NetworkFetcherFactory {
8281
var factory NetworkFetcherFactory
8382
factory.net = net
8483
factory.peerLimit = peerLimit
8584
factory.log = logging.Base()
86-
factory.fs = fs
8785
factory.cfg = cfg
8886
return factory
8987
}
@@ -119,19 +117,14 @@ func (factory NetworkFetcherFactory) New() Fetcher {
119117
// NewOverGossip returns a fetcher using the given message tag.
120118
// If there are gossip peers, then it returns a fetcher over gossip
121119
// Otherwise, it returns an HTTP fetcher
122-
// We should never build two fetchers utilising the same tag. Why?
123-
func (factory NetworkFetcherFactory) NewOverGossip(tag protocol.Tag) Fetcher {
120+
func (factory NetworkFetcherFactory) NewOverGossip() Fetcher {
124121
gossipPeers := factory.net.GetPeers(network.PeersConnectedIn)
125122
factory.log.Debugf("%d gossip peers", len(gossipPeers))
126123
if len(gossipPeers) == 0 {
127124
factory.log.Info("no gossip peers for NewOverGossip")
128125
return factory.New()
129126
}
130-
if factory.fs == nil {
131-
factory.log.Info("WsFetcherService not available; fetch over gossip disabled")
132-
return factory.New()
133-
}
134-
f := MakeWsFetcher(factory.log, tag, gossipPeers, factory.fs, factory.cfg)
127+
f := MakeWsFetcher(factory.log, gossipPeers, factory.cfg)
135128
return &ComposedFetcher{fetchers: []Fetcher{factory.New(), f}}
136129
}
137130

catchup/fetcher_test.go

+8-14
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func getAllClientsSelectedForRound(t *testing.T, fetcher *NetworkFetcher, round
131131
func TestSelectValidRemote(t *testing.T) {
132132
network := makeMockClientAggregator(t, false, false)
133133
cfg := config.GetDefaultLocal()
134-
factory := MakeNetworkFetcherFactory(network, numberOfPeers, nil, &cfg)
134+
factory := MakeNetworkFetcherFactory(network, numberOfPeers, &cfg)
135135
factory.log = logging.TestingLog(t)
136136
fetcher := factory.New()
137137
require.Equal(t, numberOfPeers, len(fetcher.(*NetworkFetcher).peers))
@@ -596,7 +596,7 @@ func TestGetBlockHTTP(t *testing.T) {
596596
_, ok := net.GetPeers(network.PeersConnectedOut)[0].(network.HTTPPeer)
597597
require.True(t, ok)
598598
cfg := config.GetDefaultLocal()
599-
factory := MakeNetworkFetcherFactory(net, numberOfPeers, nil, &cfg)
599+
factory := MakeNetworkFetcherFactory(net, numberOfPeers, &cfg)
600600
factory.log = logging.TestingLog(t)
601601
fetcher := factory.New()
602602
// we have one peer, the HTTP block server
@@ -709,7 +709,7 @@ func TestGetBlockMocked(t *testing.T) {
709709
require.NoError(t, ledgerA.AddBlock(b, agreement.Certificate{Round: next}))
710710

711711
// B tries to fetch block
712-
factory := MakeNetworkFetcherFactory(nodeB, 10, nil, &cfg)
712+
factory := MakeNetworkFetcherFactory(nodeB, 10, &cfg)
713713
factory.log = logging.TestingLog(t)
714714
nodeBRPC := factory.New()
715715
ctx, cf := context.WithTimeout(context.Background(), time.Second)
@@ -759,7 +759,7 @@ func TestGetFutureBlock(t *testing.T) {
759759
rpcs.MakeBlockService(config.GetDefaultLocal(), ledgerA, nodeA, "test genesisID")
760760

761761
// B tries to fetch block 4
762-
factory := MakeNetworkFetcherFactory(nodeB, 10, nil, &cfg)
762+
factory := MakeNetworkFetcherFactory(nodeB, 10, &cfg)
763763
factory.log = logging.TestingLog(t)
764764
nodeBRPC := factory.New()
765765
ctx, cf := context.WithTimeout(context.Background(), time.Second)
@@ -851,7 +851,7 @@ func makeTestUnicastPeer(gn network.GossipNode, version string, t *testing.T) ne
851851
// A quick GetBlock over websockets test hitting a mocked websocket server (no actual connection)
852852
func TestGetBlockWS(t *testing.T) {
853853
// test the WS fetcher:
854-
// 1. fetcher sends UniCatchupReqTag to http peer
854+
// 1. fetcher sends UniEnsBlockReqTag to http peer
855855
// 2. peer send message to gossip node
856856
// 3. gossip node send message to ledger service
857857
// 4. ledger service responds with UniCatchupResTag sending it back to the http peer
@@ -867,7 +867,7 @@ func TestGetBlockWS(t *testing.T) {
867867

868868
cfg := config.GetDefaultLocal()
869869

870-
versions := []string{"1", "2.1"}
870+
versions := []string{"2.1"}
871871
for _, version := range versions { // range network.SupportedProtocolVersions {
872872

873873
net := &httpTestPeerSource{}
@@ -881,27 +881,21 @@ func TestGetBlockWS(t *testing.T) {
881881
up := makeTestUnicastPeer(net, version, t)
882882
net.peers = append(net.peers, up)
883883

884-
fs := rpcs.MakeWsFetcherService(logging.TestingLog(t), net)
885-
fs.Start()
886-
887884
_, ok := net.GetPeers(network.PeersConnectedIn)[0].(network.UnicastPeer)
888885
require.True(t, ok)
889-
factory := MakeNetworkFetcherFactory(net, numberOfPeers, fs, &cfg)
886+
factory := MakeNetworkFetcherFactory(net, numberOfPeers, &cfg)
890887
factory.log = logging.TestingLog(t)
891-
fetcher := factory.NewOverGossip(protocol.UniCatchupReqTag)
888+
fetcher := factory.NewOverGossip()
892889
// we have one peer, the Ws block server
893890
require.Equal(t, fetcher.NumPeers(), 1)
894891

895892
var block *bookkeeping.Block
896893
var cert *agreement.Certificate
897894
var client FetcherClient
898895

899-
// start := time.Now()
900896
block, cert, client, err = fetcher.FetchBlock(context.Background(), next)
901897
require.NotNil(t, client)
902898
require.NoError(t, err)
903-
// end := time.Now()
904-
// require.True(t, end.Sub(start) < 10*time.Second)
905899
require.Equal(t, &b, block)
906900
if err == nil {
907901
require.NotEqual(t, nil, block)

catchup/pref_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func BenchmarkServiceFetchBlocks(b *testing.B) {
5656
require.NoError(b, err)
5757

5858
// Make Service
59-
syncer := MakeService(logging.Base(), defaultConfig, net, local, nil, new(mockedAuthenticator), nil)
59+
syncer := MakeService(logging.Base(), defaultConfig, net, local, new(mockedAuthenticator), nil)
6060
syncer.fetcherFactory = makeMockFactory(&MockedFetcher{ledger: remote, timeout: false, tries: make(map[basics.Round]int), latency: 100 * time.Millisecond, predictable: true})
6161

6262
b.StartTimer()

catchup/service.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"github.com/algorand/go-algorand/logging/telemetryspec"
3434
"github.com/algorand/go-algorand/network"
3535
"github.com/algorand/go-algorand/protocol"
36-
"github.com/algorand/go-algorand/rpcs"
3736
)
3837

3938
const catchupPeersForSync = 10
@@ -103,17 +102,16 @@ type BlockAuthenticator interface {
103102
}
104103

105104
// MakeService creates a catchup service instance from its constituent components
106-
// If wsf is nil, then fetch over gossip is disabled.
107-
func MakeService(log logging.Logger, config config.Local, net network.GossipNode, ledger Ledger, wsf *rpcs.WsFetcherService, auth BlockAuthenticator, unmatchedPendingCertificates <-chan PendingUnmatchedCertificate) (s *Service) {
105+
func MakeService(log logging.Logger, config config.Local, net network.GossipNode, ledger Ledger, auth BlockAuthenticator, unmatchedPendingCertificates <-chan PendingUnmatchedCertificate) (s *Service) {
108106
s = &Service{}
109107

110108
s.cfg = config
111-
s.fetcherFactory = MakeNetworkFetcherFactory(net, catchupPeersForSync, wsf, &config)
109+
s.fetcherFactory = MakeNetworkFetcherFactory(net, catchupPeersForSync, &config)
112110
s.ledger = ledger
113111
s.net = net
114112
s.auth = auth
115113
s.unmatchedPendingCertificates = unmatchedPendingCertificates
116-
s.latestRoundFetcherFactory = MakeNetworkFetcherFactory(net, blockQueryPeerLimit, wsf, &config)
114+
s.latestRoundFetcherFactory = MakeNetworkFetcherFactory(net, blockQueryPeerLimit, &config)
117115
s.log = log.With("Context", "sync")
118116
s.parallelBlocks = config.CatchupParallelBlocks
119117
s.deadlineTimeout = agreement.DeadlineTimeout()
@@ -324,7 +322,7 @@ func (s *Service) pipelineCallback(fetcher Fetcher, r basics.Round, thisFetchCom
324322

325323
// TODO the following code does not handle the following case: seedLookback upgrades during fetch
326324
func (s *Service) pipelinedFetch(seedLookback uint64) {
327-
fetcher := s.fetcherFactory.NewOverGossip(protocol.UniCatchupReqTag)
325+
fetcher := s.fetcherFactory.NewOverGossip()
328326
defer fetcher.Close()
329327

330328
// make sure that we have at least one peer
@@ -559,7 +557,7 @@ func (s *Service) syncCert(cert *PendingUnmatchedCertificate) {
559557
// TODO this doesn't actually use the digest from cert!
560558
func (s *Service) fetchRound(cert agreement.Certificate, verifier *agreement.AsyncVoteVerifier) {
561559
blockHash := bookkeeping.BlockHash(cert.Proposal.BlockDigest) // semantic digest (i.e., hash of the block header), not byte-for-byte digest
562-
fetcher := s.latestRoundFetcherFactory.NewOverGossip(protocol.UniEnsBlockReqTag)
560+
fetcher := s.latestRoundFetcherFactory.NewOverGossip()
563561
defer func() {
564562
fetcher.Close()
565563
}()
@@ -569,7 +567,7 @@ func (s *Service) fetchRound(cert agreement.Certificate, verifier *agreement.Asy
569567
// refresh peers and try again
570568
logging.Base().Warn("fetchRound found no outgoing peers")
571569
s.net.RequestConnectOutgoing(true, s.ctx.Done())
572-
fetcher = s.latestRoundFetcherFactory.NewOverGossip(protocol.UniEnsBlockReqTag)
570+
fetcher = s.latestRoundFetcherFactory.NewOverGossip()
573571
}
574572
// Ask the fetcher to get the block somehow
575573
block, fetchedCert, rpcc, err := s.innerFetch(fetcher, cert.Round)

0 commit comments

Comments
 (0)