Skip to content

Commit e10fe1c

Browse files
authored
txnsync: rollback (algorand#3177)
## Summary This PR rolls back the txsync, retaining only the config file changes
1 parent 3a6238d commit e10fe1c

File tree

195 files changed

+439
-70993
lines changed

Some content is hidden

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

195 files changed

+439
-70993
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ GOLDFLAGS := $(GOLDFLAGS_BASE) \
7676
UNIT_TEST_SOURCES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && go list ./... | grep -v /go-algorand/test/ ))
7777
ALGOD_API_PACKAGES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && cd daemon/algod/api; go list ./... ))
7878

79-
MSGP_GENERATE := ./protocol ./protocol/test ./crypto ./crypto/compactcert ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./agreement ./rpcs ./node ./ledger ./ledger/ledgercore ./compactcert ./txnsync ./data/pooldata
79+
MSGP_GENERATE := ./protocol ./protocol/test ./crypto ./crypto/compactcert ./data/basics ./data/transactions ./data/committee ./data/bookkeeping ./data/hashable ./agreement ./rpcs ./node ./ledger ./ledger/ledgercore ./compactcert
8080

8181
default: build
8282

catchup/fetcher_test.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"net/url"
2424
"strings"
2525
"testing"
26-
"time"
2726

2827
"github.com/gorilla/mux"
2928
"github.com/stretchr/testify/require"
@@ -288,16 +287,7 @@ func (p *testUnicastPeer) Version() string {
288287
return p.version
289288
}
290289

291-
func (p *testUnicastPeer) IsOutgoing() bool {
292-
return false
293-
}
294-
295-
// GetConnectionLatency returns the connection latency between the local node and this peer.
296-
func (p *testUnicastPeer) GetConnectionLatency() time.Duration {
297-
return time.Duration(0)
298-
}
299-
300-
func (p *testUnicastPeer) Unicast(ctx context.Context, msg []byte, tag protocol.Tag, callback network.UnicastWebsocketMessageStateCallback) error {
290+
func (p *testUnicastPeer) Unicast(ctx context.Context, msg []byte, tag protocol.Tag) error {
301291
ps := p.gn.(*httpTestPeerSource)
302292
var dispather network.MessageHandler
303293
for _, v := range ps.dispatchHandlers {

catchup/peerSelector_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type mockUnicastPeer struct {
5050
func (d *mockUnicastPeer) GetAddress() string {
5151
return d.address
5252
}
53-
func (d *mockUnicastPeer) Unicast(ctx context.Context, msg []byte, tag protocol.Tag, callback network.UnicastWebsocketMessageStateCallback) error {
53+
func (d *mockUnicastPeer) Unicast(ctx context.Context, data []byte, tag protocol.Tag) error {
5454
return nil
5555
}
5656
func (d *mockUnicastPeer) Version() string {
@@ -62,9 +62,6 @@ func (d *mockUnicastPeer) Request(ctx context.Context, tag network.Tag, topics n
6262
func (d *mockUnicastPeer) Respond(ctx context.Context, reqMsg network.IncomingMessage, topics network.Topics) (e error) {
6363
return nil
6464
}
65-
func (d *mockUnicastPeer) IsOutgoing() bool {
66-
return false
67-
}
6865

6966
// GetConnectionLatency returns the connection latency between the local node and this peer.
7067
func (d *mockUnicastPeer) GetConnectionLatency() time.Duration {

config/localTemplate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type Local struct {
6262
MaxConnectionsPerIP int `version[3]:"30"`
6363

6464
// 0 == disable
65-
PeerPingPeriodSeconds int `version[0]:"0" version[18]:"10"`
65+
PeerPingPeriodSeconds int `version[0]:"0"`
6666

6767
// for https serving
6868
TLSCertFile string `version[0]:""`

config/local_defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var defaultLocal = Local{
9292
OutgoingMessageFilterBucketSize: 128,
9393
ParticipationKeysRefreshInterval: 60000000000,
9494
PeerConnectionsUpdateInterval: 3600,
95-
PeerPingPeriodSeconds: 10,
95+
PeerPingPeriodSeconds: 0,
9696
PriorityPeers: map[string]bool{},
9797
ProposalAssemblyTime: 250000000,
9898
PublicAddress: "",

crypto/compactcert/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,5 @@ func numReveals(signedWeight uint64, provenWeight uint64, secKQ uint64, bound ui
113113
}
114114

115115
func (p Params) numReveals(signedWeight uint64) (uint64, error) {
116-
return numReveals(signedWeight, p.ProvenWeight, p.SecKQ, MaxReveals)
116+
return numReveals(signedWeight, p.ProvenWeight, p.SecKQ, maxReveals)
117117
}

crypto/compactcert/msgp_gen.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crypto/compactcert/structs.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,23 @@ type Reveal struct {
6363
Part basics.Participant `codec:"p"`
6464
}
6565

66-
// MaxReveals is a bound on allocation and on numReveals to limit log computation
67-
const MaxReveals = 1024
68-
69-
// MaxProofDigests is a bound on allocation on number of proofs
70-
const MaxProofDigests = 20 * MaxReveals
66+
// maxReveals is a bound on allocation and on numReveals to limit log computation
67+
const maxReveals = 1024
68+
const maxProofDigests = 20 * maxReveals
7169

7270
// Cert represents a compact certificate.
7371
type Cert struct {
7472
_struct struct{} `codec:",omitempty,omitemptyarray"`
7573

7674
SigCommit crypto.Digest `codec:"c"`
7775
SignedWeight uint64 `codec:"w"`
78-
SigProofs []crypto.Digest `codec:"S,allocbound=MaxProofDigests"`
79-
PartProofs []crypto.Digest `codec:"P,allocbound=MaxProofDigests"`
76+
SigProofs []crypto.Digest `codec:"S,allocbound=maxProofDigests"`
77+
PartProofs []crypto.Digest `codec:"P,allocbound=maxProofDigests"`
8078

8179
// Reveals is a sparse map from the position being revealed
8280
// to the corresponding elements from the sigs and participants
8381
// arrays.
84-
Reveals map[uint64]Reveal `codec:"r,allocbound=MaxReveals"`
82+
Reveals map[uint64]Reveal `codec:"r,allocbound=maxReveals"`
8583
}
8684

8785
// SortUint64 implements sorting by uint64 keys for

crypto/curve25519.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,10 @@ func init() {
6969
// A Seed holds the entropy needed to generate cryptographic keys.
7070
type Seed ed25519Seed
7171

72-
// PublicKeyByteLength is the length, in bytes, of a public key
73-
const PublicKeyByteLength = 32
74-
75-
// PrivateKeyByteLength is the length, in bytes, of a private key
76-
const PrivateKeyByteLength = 64
77-
78-
// SignatureByteLength is the length, in bytes, of a signature
79-
const SignatureByteLength = 64
80-
8172
/* Classical signatures */
82-
type ed25519Signature [SignatureByteLength]byte
83-
type ed25519PublicKey [PublicKeyByteLength]byte
84-
type ed25519PrivateKey [PrivateKeyByteLength]byte
73+
type ed25519Signature [64]byte
74+
type ed25519PublicKey [32]byte
75+
type ed25519PrivateKey [64]byte
8576
type ed25519Seed [32]byte
8677

8778
// MasterDerivationKey is used to derive ed25519 keys for use in wallets

crypto/msgp_gen.go

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)