Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e8e1b41
API: bump max size of teal source and dryrun (#4633)
barnjamin Oct 24, 2022
5b028c2
Merge remote-tracking branch 'origin/rel/stable' into relstable3.11.2…
Algo-devops-service Oct 24, 2022
1a83da0
Bump Version, Remove buildnumber.dat and genesistimestamp.dat files.
Algo-devops-service Oct 24, 2022
0c2bc3a
Merge pull request #4688 from Algo-devops-service/relstable3.11.2-rem…
algojohnlee Oct 24, 2022
fbd5b17
ledger: Make AccountDelta fields visible for serialization. (#4620)
winder Oct 24, 2022
5e0ea76
perf test: Transaction group handle/verify (#4652)
algonautshant Oct 24, 2022
fb332de
Netgoal: Update netgoal generate flags and variables (#4656)
algobarb Oct 25, 2022
6a2942d
lint: enable go vet printf format arg checks for logging (#4679)
cce Oct 25, 2022
ad08f74
logging: demote LeaseInLedgerError from warn to info level (#4685)
cce Oct 26, 2022
a3e90ad
test: metrics gathering improvements (#4639)
brianolson Oct 26, 2022
4e36847
Tests: Fix handling of empty local state in TestResourcesDataApp (#4699)
michaeldiamant Oct 26, 2022
ab87a8a
AVM: match, pushints, and pushbytess opcodes (#4645)
algoidurovic Oct 26, 2022
40974ee
network: align duplicateFilterCount to prevent panic on 32-bit platfo…
cce Oct 28, 2022
e2c2bc4
Bug-fix: return v2 spec from swagger endpoint (#4697)
AlgoStephenAkiki Oct 28, 2022
0cb9a2e
AVM: Add support for Boxes (#4149)
michaeldiamant Oct 31, 2022
7602d4f
performance: don't create child cow in TestTransactionGroup (#4706)
cce Oct 31, 2022
fb1f498
db: print dbutil.go error in stderr (#4712)
michaeldiamant Oct 31, 2022
ba9c593
performance: agreement state serialization using msgp (#4644)
iansuvak Oct 31, 2022
e6f396b
prefetcher: enable prefetcher for assets and apps (#4352)
algorandskiy Oct 31, 2022
97c232d
test: fix after boxes and prefetcher remerge (#4716)
algorandskiy Nov 1, 2022
959fb5a
blank import needs commenting out for indexer's lint (#4720)
tzaffi Nov 1, 2022
bac4117
AVM: fix early eval exits for Debugger (#4719)
jannotti Nov 1, 2022
daca5d3
DevOps: Update docker container in build (#4723)
onetechnical Nov 1, 2022
15efc02
catchpoint: actualize limit constants and fix txtail table init (#4703)
algorandskiy Nov 1, 2022
a8f1b4a
tools: allow specification of RewardPoolBalance in genesis (#4643)
barnjamin Nov 1, 2022
06f9109
Consensus: v36 upgrade (#4722)
jannotti Nov 1, 2022
f37bb6e
dispenser: add input validation (#4713)
algolucky Nov 1, 2022
2c0dd9e
Update the Version, BuildNumber, genesistimestamp.data
Algo-devops-service Nov 1, 2022
31a1099
Merge pull request #4730 from Algo-devops-service/relbeta3.12.0
algojohnlee Nov 1, 2022
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
41 changes: 39 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,43 @@ linters-settings:
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).error
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).warnf
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).warn
# We do this 121 times and never check the error.
- (*github.com/spf13/cobra.Command).MarkFlagRequired
govet:
settings:
printf:
# Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`).
# Default: []
funcs:
- (github.com/algorand/go-algorand/logging.Logger).Debugf
- (github.com/algorand/go-algorand/logging.Logger).Infof
- (github.com/algorand/go-algorand/logging.Logger).Warnf
- (github.com/algorand/go-algorand/logging.Logger).Errorf
- (github.com/algorand/go-algorand/logging.Logger).Fatalf
- (github.com/algorand/go-algorand/logging.Logger).Panicf
- (github.com/algorand/go-algorand/logging.Logger).Debugln
- (github.com/algorand/go-algorand/logging.Logger).Infoln
- (github.com/algorand/go-algorand/logging.Logger).Warnln
- (github.com/algorand/go-algorand/logging.Logger).Errorln
- (github.com/algorand/go-algorand/logging.Logger).Fatalln
- (github.com/algorand/go-algorand/logging.Logger).Panicln
- (github.com/algorand/go-algorand/logging.Logger).Debug
- (github.com/algorand/go-algorand/logging.Logger).Info
- (github.com/algorand/go-algorand/logging.Logger).Warn
- (github.com/algorand/go-algorand/logging.Logger).Error
- (github.com/algorand/go-algorand/logging.Logger).Fatal
- (github.com/algorand/go-algorand/logging.Logger).Panic
- (github.com/algorand/go-algorand/data/transactions/logic.OpStream).warnf
- (github.com/algorand/go-algorand/data/transactions/logic.OpStream).errorf
- (github.com/algorand/go-algorand/data/transactions/logic.OpStream).lineErrorf
- (github.com/algorand/go-algorand/cmd/goal/main).reportInfof
- (github.com/algorand/go-algorand/cmd/goal/main).reportInfoln
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnf
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnln
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnRawf
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnRawln
- (github.com/algorand/go-algorand/cmd/goal/main).reportErrorf
- (github.com/algorand/go-algorand/cmd/goal/main).reportErrorln

issues:
# Work our way back over time to be clean against all these
Expand Down Expand Up @@ -69,9 +106,9 @@ issues:
- path: _test\.go
linters:
- errcheck
- gofmt
# - gofmt
- gosimple
- govet
# - govet
- ineffassign
- misspell
- nolintlint
Expand Down
23 changes: 11 additions & 12 deletions agreement/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import (
)

//go:generate stringer -type=actionType
//msgp:ignore actionType
type actionType int
type actionType uint8

const (
noop actionType = iota
Expand Down Expand Up @@ -103,7 +102,7 @@ type networkAction struct {

UnauthenticatedVotes []unauthenticatedVote

Err serializableError
Err *serializableError
}

func (a networkAction) t() actionType {
Expand Down Expand Up @@ -181,7 +180,7 @@ type cryptoAction struct {
Period period
Step step
Pinned bool
TaskIndex int
TaskIndex uint64
}

func (a cryptoAction) t() actionType {
Expand Down Expand Up @@ -388,7 +387,7 @@ func (a pseudonodeAction) do(ctx context.Context, s *Service) {
case nil:
// no error.
persistCompleteEvents := s.persistState(persistStateDone)
// we want to place there two one after the other. That way, the second would not get executed up until the first one is complete.
// we want to place these two one after the other. That way, the second would not get executed up until the first one is complete.
s.demux.prioritize(persistCompleteEvents)
s.demux.prioritize(voteEvents)
default:
Expand All @@ -403,12 +402,12 @@ func (a pseudonodeAction) do(ctx context.Context, s *Service) {
}
}

func ignoreAction(e messageEvent, err serializableError) action {
return networkAction{T: ignore, Err: err, h: e.Input.MessageHandle}
func ignoreAction(e messageEvent, err *serializableError) action {
return networkAction{T: ignore, Err: err, h: e.Input.messageHandle}
}

func disconnectAction(e messageEvent, err serializableError) action {
return networkAction{T: disconnect, Err: err, h: e.Input.MessageHandle}
func disconnectAction(e messageEvent, err *serializableError) action {
return networkAction{T: disconnect, Err: err, h: e.Input.messageHandle}
}

func broadcastAction(tag protocol.Tag, o interface{}) action {
Expand All @@ -427,7 +426,7 @@ func broadcastAction(tag protocol.Tag, o interface{}) action {
}

func relayAction(e messageEvent, tag protocol.Tag, o interface{}) action {
a := networkAction{T: relay, h: e.Input.MessageHandle, Tag: tag}
a := networkAction{T: relay, h: e.Input.messageHandle, Tag: tag}
// TODO would be good to have compiler check this (and related) type switch
// by specializing one method per type
switch tag {
Expand All @@ -441,7 +440,7 @@ func relayAction(e messageEvent, tag protocol.Tag, o interface{}) action {
return a
}

func verifyVoteAction(e messageEvent, r round, p period, taskIndex int) action {
func verifyVoteAction(e messageEvent, r round, p period, taskIndex uint64) action {
return cryptoAction{T: verifyVote, M: e.Input, Round: r, Period: p, TaskIndex: taskIndex}
}

Expand Down Expand Up @@ -479,7 +478,7 @@ type checkpointAction struct {
Round round
Period period
Step step
Err serializableError
Err *serializableError
done chan error // an output channel to let the pseudonode that we're done processing. We don't want to serialize that, since it's not needed in recovery/autopsy
}

Expand Down
2 changes: 1 addition & 1 deletion agreement/actiontype_string.go

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

8 changes: 4 additions & 4 deletions agreement/asyncVoteVerifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type asyncVerifyVoteRequest struct {
l LedgerReader
uv *unauthenticatedVote
uev *unauthenticatedEquivocationVote
index int
index uint64
message message

// a channel that holds the response
Expand All @@ -39,7 +39,7 @@ type asyncVerifyVoteRequest struct {
type asyncVerifyVoteResponse struct {
v vote
ev equivocationVote
index int
index uint64
message message
err error
cancelled bool
Expand Down Expand Up @@ -131,7 +131,7 @@ func (avv *AsyncVoteVerifier) executeEqVoteVerification(task interface{}) interf
}
}

func (avv *AsyncVoteVerifier) verifyVote(verctx context.Context, l LedgerReader, uv unauthenticatedVote, index int, message message, out chan<- asyncVerifyVoteResponse) error {
func (avv *AsyncVoteVerifier) verifyVote(verctx context.Context, l LedgerReader, uv unauthenticatedVote, index uint64, message message, out chan<- asyncVerifyVoteResponse) error {
select {
case <-avv.ctx.Done(): // if we're quitting, don't enqueue the request
// case <-verctx.Done(): DO NOT DO THIS! otherwise we will lose the vote (and forget to clean up)!
Expand All @@ -151,7 +151,7 @@ func (avv *AsyncVoteVerifier) verifyVote(verctx context.Context, l LedgerReader,
return nil
}

func (avv *AsyncVoteVerifier) verifyEqVote(verctx context.Context, l LedgerReader, uev unauthenticatedEquivocationVote, index int, message message, out chan<- asyncVerifyVoteResponse) error {
func (avv *AsyncVoteVerifier) verifyEqVote(verctx context.Context, l LedgerReader, uev unauthenticatedEquivocationVote, index uint64, message message, out chan<- asyncVerifyVoteResponse) error {
select {
case <-avv.ctx.Done(): // if we're quitting, don't enqueue the request
// case <-verctx.Done(): DO NOT DO THIS! otherwise we will lose the vote (and forget to clean up)!
Expand Down
6 changes: 4 additions & 2 deletions agreement/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ func (b unauthenticatedBundle) verifyAsync(ctx context.Context, l LedgerReader,

rv := rawVote{Sender: auth.Sender, Round: b.Round, Period: b.Period, Step: b.Step, Proposal: b.Proposal}
uv := unauthenticatedVote{R: rv, Cred: auth.Cred, Sig: auth.Sig}
avv.verifyVote(ctx, l, uv, i, message{}, results)

avv.verifyVote(ctx, l, uv, uint64(i), message{}, results) //nolint:errcheck // verifyVote will call EnqueueBacklog, which blocks until the verify task is queued, or returns an error when ctx.Done(), which we are already checking
}

// create verification requests for equivocation votes
Expand All @@ -222,7 +223,8 @@ func (b unauthenticatedBundle) verifyAsync(ctx context.Context, l LedgerReader,
Proposals: auth.Proposals,
Sigs: auth.Sigs,
}
avv.verifyEqVote(ctx, l, uev, i, message{}, results)
avv.verifyEqVote(ctx, l, uev, uint64(i), message{}, results) //nolint:errcheck // verifyVote will call EnqueueBacklog, which blocks until the verify task is queued, or returns an error when ctx.Done(), which we are already checking

}

return func() (bundle, error) {
Expand Down
2 changes: 1 addition & 1 deletion agreement/cadaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (c *cadaver) trySetup() bool {
if c.out.bytesWritten >= c.fileSizeTarget {
err := c.out.Close()
if err != nil {
logging.Base().Warn("unable to close cadaver file : %v", err)
logging.Base().Warnf("unable to close cadaver file : %v", err)
}
err = os.Rename(c.filename(), c.filename()+".archive")
if err != nil {
Expand Down
19 changes: 12 additions & 7 deletions agreement/cryptoVerifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,41 @@ type (
Quit()
}

//msgp:ignore cryptoVoteRequest
cryptoVoteRequest struct {
message // the message we would like to verify.
TaskIndex int // Caller specific number that would be passed back in the asyncVerifyVoteResponse.TaskIndex field
TaskIndex uint64 // Caller specific number that would be passed back in the asyncVerifyVoteResponse.TaskIndex field
Round round // The round that we're going to test against.
Period period // The period associated with the message we're going to test.
ctx context.Context // A context for this request, if the context is cancelled then the request is stale.
}

//msgp:ignore cryptoProposalRequest
cryptoProposalRequest struct {
message // the message we would like to verify.
TaskIndex int // Caller specific number that would be passed back in the cryptoResult.TaskIndex field
TaskIndex uint64 // Caller specific number that would be passed back in the cryptoResult.TaskIndex field
Round round // The round that we're going to test against.
Period period // The period associated with the message we're going to test.
Pinned bool // A flag that is set if this is a pinned value for the given round.
ctx context.Context // A context for this request, if the context is cancelled then the request is stale.
}

//msgp:ignore cryptoBundleRequest
cryptoBundleRequest struct {
message // the message we would like to verify.
TaskIndex int // Caller specific number that would be passed back in the asyncVerifyVoteResponse.TaskIndex field
TaskIndex uint64 // Caller specific number that would be passed back in the asyncVerifyVoteResponse.TaskIndex field
Round round // The round that we're going to test against.
Period period // The period associated with the message we're going to test.
Certify bool // A flag that set if this is a cert bundle.
ctx context.Context // A context for this request, if the context is cancelled then the request is stale.
}

//msgp:ignore cryptoResult
cryptoResult struct {
message
Err serializableError
TaskIndex int // the TaskIndex that was passed to the cryptoVerifier during the Verify call on the cryptoRequest.TaskIndex
Cancelled bool // whether the corresponding request was cancelled before verification completed
Err *serializableError
TaskIndex uint64 // the TaskIndex that was passed to the cryptoVerifier during the Verify call on the cryptoRequest.TaskIndex
Cancelled bool // whether the corresponding request was cancelled before verification completed
}

// A poolCryptoVerifier uses asynchronous goroutines to implement cryptoVerifier.
Expand Down Expand Up @@ -146,9 +150,10 @@ type (
out chan cryptoResult
}

//msgp:ignore bundleFuture
bundleFuture struct {
message
index int
index uint64
wait func() (bundle, error)
ctx context.Context
}
Expand Down
20 changes: 10 additions & 10 deletions agreement/cryptoVerifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func makeMessage(msgHandle int, tag protocol.Tag, sender basics.Address, l Ledge
}

return message{
MessageHandle: MessageHandle(msgHandle),
messageHandle: MessageHandle(msgHandle),
Tag: tag,
UnauthenticatedVote: makeUnauthenticatedVote(l, sender, selection, voting, Round, Period, Step, proposal),
}
Expand All @@ -103,13 +103,13 @@ func makeMessage(msgHandle int, tag protocol.Tag, sender basics.Address, l Ledge
Block: e,
}
return message{
MessageHandle: MessageHandle(msgHandle),
messageHandle: MessageHandle(msgHandle),
Tag: tag,
UnauthenticatedProposal: payload,
}
default: // protocol.VoteBundleTag
return message{
MessageHandle: MessageHandle(msgHandle),
messageHandle: MessageHandle(msgHandle),
Tag: tag,
UnauthenticatedBundle: unauthenticatedBundle{
Round: Round,
Expand Down Expand Up @@ -180,9 +180,9 @@ func TestCryptoVerifierBuffers(t *testing.T) {
for _, msgType := range msgTypes {
for i := getSelectorCapacity(msgType) * 5; i > 0; i-- {
msg := <-verifier.Verified(msgType)
_, has := usedMsgIDs[msg.MessageHandle]
_, has := usedMsgIDs[msg.messageHandle]
assert.True(t, has)
delete(usedMsgIDs, msg.MessageHandle)
delete(usedMsgIDs, msg.messageHandle)
}
assert.False(t, verifier.ChannelFull(msgType))
assert.Zero(t, len(verifier.Verified(msgType)))
Expand Down Expand Up @@ -230,8 +230,8 @@ func TestCryptoVerifierBuffers(t *testing.T) {
}
msgIDMutex.Lock()
defer msgIDMutex.Unlock()
_, has := usedMsgIDs[msg.MessageHandle]
delete(usedMsgIDs, msg.MessageHandle)
_, has := usedMsgIDs[msg.messageHandle]
delete(usedMsgIDs, msg.messageHandle)
return assert.True(t, has)
}

Expand Down Expand Up @@ -333,7 +333,7 @@ func BenchmarkCryptoVerifierProposalVertification(b *testing.B) {
c := verifier.Verified(protocol.ProposalPayloadTag)
request := cryptoProposalRequest{
message: message{
MessageHandle: MessageHandle(0),
messageHandle: MessageHandle(0),
Tag: protocol.ProposalPayloadTag,
UnauthenticatedProposal: proposals[0].unauthenticatedProposal,
},
Expand Down Expand Up @@ -402,11 +402,11 @@ func TestCryptoVerifierVerificationFailures(t *testing.T) {
cryptoVerifier := makeCryptoVerifier(nil, nil, voteVerifier, logging.TestingLog(t))
defer cryptoVerifier.Quit()

cryptoVerifier.VerifyVote(context.Background(), cryptoVoteRequest{message: message{Tag: protocol.AgreementVoteTag}, Round: basics.Round(8), TaskIndex: 14})
cryptoVerifier.VerifyVote(context.Background(), cryptoVoteRequest{message: message{Tag: protocol.AgreementVoteTag}, Round: basics.Round(8), TaskIndex: uint64(14)})
// read the failed response from VerifiedVotes:
votesout := cryptoVerifier.VerifiedVotes()
voteResponse := <-votesout
require.Equal(t, context.Canceled, voteResponse.err)
require.True(t, voteResponse.cancelled)
require.Equal(t, 14, voteResponse.index)
require.Equal(t, uint64(14), voteResponse.index)
}
10 changes: 5 additions & 5 deletions agreement/demux.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ func (d *demux) tokenizeMessages(ctx context.Context, net Network, tag protocol.
var msg message
switch tag {
case protocol.AgreementVoteTag:
msg = message{MessageHandle: raw.MessageHandle, Tag: tag, UnauthenticatedVote: o.(unauthenticatedVote)}
msg = message{messageHandle: raw.MessageHandle, Tag: tag, UnauthenticatedVote: o.(unauthenticatedVote)}
case protocol.VoteBundleTag:
msg = message{MessageHandle: raw.MessageHandle, Tag: tag, UnauthenticatedBundle: o.(unauthenticatedBundle)}
msg = message{messageHandle: raw.MessageHandle, Tag: tag, UnauthenticatedBundle: o.(unauthenticatedBundle)}
case protocol.ProposalPayloadTag:
msg = message{MessageHandle: raw.MessageHandle, Tag: tag, CompoundMessage: o.(compoundMessage)}
msg = message{messageHandle: raw.MessageHandle, Tag: tag, CompoundMessage: o.(compoundMessage)}
default:
err := fmt.Errorf("bad message tag: %v", tag)
d.UpdateEventsQueue(fmt.Sprintf("Tokenizing-%s", tag), 0)
Expand All @@ -167,7 +167,7 @@ func (d *demux) tokenizeMessages(ctx context.Context, net Network, tag protocol.
}

// verifyVote enqueues a vote message to be verified.
func (d *demux) verifyVote(ctx context.Context, m message, taskIndex int, r round, p period) {
func (d *demux) verifyVote(ctx context.Context, m message, taskIndex uint64, r round, p period) {
d.UpdateEventsQueue(eventQueueCryptoVerifierVote, 1)
d.monitor.inc(cryptoVerifierCoserviceType)
d.crypto.VerifyVote(ctx, cryptoVoteRequest{message: m, TaskIndex: taskIndex, Round: r, Period: p})
Expand Down Expand Up @@ -367,7 +367,7 @@ func setupCompoundMessage(l LedgerReader, m message) (res externalEvent) {
return
}

tailmsg := message{MessageHandle: m.MessageHandle, Tag: protocol.ProposalPayloadTag, UnauthenticatedProposal: compound.Proposal}
tailmsg := message{messageHandle: m.messageHandle, Tag: protocol.ProposalPayloadTag, UnauthenticatedProposal: compound.Proposal}
synthetic := messageEvent{T: payloadPresent, Input: tailmsg}
proto, err := l.ConsensusVersion(ParamsRound(synthetic.ConsensusRound()))
synthetic = synthetic.AttachConsensusVersion(ConsensusVersionView{Err: makeSerErr(err), Version: proto}).(messageEvent)
Expand Down
Loading