Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txnsync: rollback #3177

Merged
merged 17 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ GOLDFLAGS := $(GOLDFLAGS_BASE) \
UNIT_TEST_SOURCES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && go list ./... | grep -v /go-algorand/test/ ))
ALGOD_API_PACKAGES := $(sort $(shell GOPATH=$(GOPATH) && GO111MODULE=off && cd daemon/algod/api; go list ./... ))

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
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

default: build

Expand Down
12 changes: 1 addition & 11 deletions catchup/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"net/url"
"strings"
"testing"
"time"

"github.com/gorilla/mux"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -288,16 +287,7 @@ func (p *testUnicastPeer) Version() string {
return p.version
}

func (p *testUnicastPeer) IsOutgoing() bool {
return false
}

// GetConnectionLatency returns the connection latency between the local node and this peer.
func (p *testUnicastPeer) GetConnectionLatency() time.Duration {
return time.Duration(0)
}

func (p *testUnicastPeer) Unicast(ctx context.Context, msg []byte, tag protocol.Tag, callback network.UnicastWebsocketMessageStateCallback) error {
func (p *testUnicastPeer) Unicast(ctx context.Context, msg []byte, tag protocol.Tag) error {
ps := p.gn.(*httpTestPeerSource)
var dispather network.MessageHandler
for _, v := range ps.dispatchHandlers {
Expand Down
5 changes: 1 addition & 4 deletions catchup/peerSelector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type mockUnicastPeer struct {
func (d *mockUnicastPeer) GetAddress() string {
return d.address
}
func (d *mockUnicastPeer) Unicast(ctx context.Context, msg []byte, tag protocol.Tag, callback network.UnicastWebsocketMessageStateCallback) error {
func (d *mockUnicastPeer) Unicast(ctx context.Context, data []byte, tag protocol.Tag) error {
return nil
}
func (d *mockUnicastPeer) Version() string {
Expand All @@ -62,9 +62,6 @@ func (d *mockUnicastPeer) Request(ctx context.Context, tag network.Tag, topics n
func (d *mockUnicastPeer) Respond(ctx context.Context, reqMsg network.IncomingMessage, topics network.Topics) (e error) {
return nil
}
func (d *mockUnicastPeer) IsOutgoing() bool {
return false
}

// GetConnectionLatency returns the connection latency between the local node and this peer.
func (d *mockUnicastPeer) GetConnectionLatency() time.Duration {
Expand Down
2 changes: 1 addition & 1 deletion config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Local struct {
MaxConnectionsPerIP int `version[3]:"30"`

// 0 == disable
PeerPingPeriodSeconds int `version[0]:"0" version[18]:"10"`
PeerPingPeriodSeconds int `version[0]:"0"`

// for https serving
TLSCertFile string `version[0]:""`
Expand Down
2 changes: 1 addition & 1 deletion config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var defaultLocal = Local{
OutgoingMessageFilterBucketSize: 128,
ParticipationKeysRefreshInterval: 60000000000,
PeerConnectionsUpdateInterval: 3600,
PeerPingPeriodSeconds: 10,
PeerPingPeriodSeconds: 0,
PriorityPeers: map[string]bool{},
ProposalAssemblyTime: 250000000,
PublicAddress: "",
Expand Down
2 changes: 1 addition & 1 deletion crypto/compactcert/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ func numReveals(signedWeight uint64, provenWeight uint64, secKQ uint64, bound ui
}

func (p Params) numReveals(signedWeight uint64) (uint64, error) {
return numReveals(signedWeight, p.ProvenWeight, p.SecKQ, MaxReveals)
return numReveals(signedWeight, p.ProvenWeight, p.SecKQ, maxReveals)
}
24 changes: 12 additions & 12 deletions crypto/compactcert/msgp_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions crypto/compactcert/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,23 @@ type Reveal struct {
Part basics.Participant `codec:"p"`
}

// MaxReveals is a bound on allocation and on numReveals to limit log computation
const MaxReveals = 1024

// MaxProofDigests is a bound on allocation on number of proofs
const MaxProofDigests = 20 * MaxReveals
// maxReveals is a bound on allocation and on numReveals to limit log computation
const maxReveals = 1024
const maxProofDigests = 20 * maxReveals

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

SigCommit crypto.Digest `codec:"c"`
SignedWeight uint64 `codec:"w"`
SigProofs []crypto.Digest `codec:"S,allocbound=MaxProofDigests"`
PartProofs []crypto.Digest `codec:"P,allocbound=MaxProofDigests"`
SigProofs []crypto.Digest `codec:"S,allocbound=maxProofDigests"`
PartProofs []crypto.Digest `codec:"P,allocbound=maxProofDigests"`

// Reveals is a sparse map from the position being revealed
// to the corresponding elements from the sigs and participants
// arrays.
Reveals map[uint64]Reveal `codec:"r,allocbound=MaxReveals"`
Reveals map[uint64]Reveal `codec:"r,allocbound=maxReveals"`
}

// SortUint64 implements sorting by uint64 keys for
Expand Down
15 changes: 3 additions & 12 deletions crypto/curve25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,10 @@ func init() {
// A Seed holds the entropy needed to generate cryptographic keys.
type Seed ed25519Seed

// PublicKeyByteLength is the length, in bytes, of a public key
const PublicKeyByteLength = 32

// PrivateKeyByteLength is the length, in bytes, of a private key
const PrivateKeyByteLength = 64

// SignatureByteLength is the length, in bytes, of a signature
const SignatureByteLength = 64

/* Classical signatures */
type ed25519Signature [SignatureByteLength]byte
type ed25519PublicKey [PublicKeyByteLength]byte
type ed25519PrivateKey [PrivateKeyByteLength]byte
type ed25519Signature [64]byte
type ed25519PublicKey [32]byte
type ed25519PrivateKey [64]byte
type ed25519Seed [32]byte

// MasterDerivationKey is used to derive ed25519 keys for use in wallets
Expand Down
46 changes: 23 additions & 23 deletions crypto/msgp_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading