diff --git a/.golangci.yml b/.golangci.yml
index 271c682e50..62490feca4 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -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
@@ -69,9 +106,9 @@ issues:
- path: _test\.go
linters:
- errcheck
- - gofmt
+ # - gofmt
- gosimple
- - govet
+ # - govet
- ineffassign
- misspell
- nolintlint
diff --git a/agreement/actions.go b/agreement/actions.go
index 779d9d4676..ca33c18db1 100644
--- a/agreement/actions.go
+++ b/agreement/actions.go
@@ -26,8 +26,7 @@ import (
)
//go:generate stringer -type=actionType
-//msgp:ignore actionType
-type actionType int
+type actionType uint8
const (
noop actionType = iota
@@ -103,7 +102,7 @@ type networkAction struct {
UnauthenticatedVotes []unauthenticatedVote
- Err serializableError
+ Err *serializableError
}
func (a networkAction) t() actionType {
@@ -181,7 +180,7 @@ type cryptoAction struct {
Period period
Step step
Pinned bool
- TaskIndex int
+ TaskIndex uint64
}
func (a cryptoAction) t() actionType {
@@ -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:
@@ -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 {
@@ -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 {
@@ -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}
}
@@ -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
}
diff --git a/agreement/actiontype_string.go b/agreement/actiontype_string.go
index c27b9138bb..9272ec2cf6 100644
--- a/agreement/actiontype_string.go
+++ b/agreement/actiontype_string.go
@@ -31,7 +31,7 @@ const _actionType_name = "noopignorebroadcastrelaydisconnectbroadcastVotesverify
var _actionType_index = [...]uint8{0, 4, 10, 19, 24, 34, 48, 58, 71, 83, 89, 100, 106, 112, 120, 129, 139}
func (i actionType) String() string {
- if i < 0 || i >= actionType(len(_actionType_index)-1) {
+ if i >= actionType(len(_actionType_index)-1) {
return "actionType(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _actionType_name[_actionType_index[i]:_actionType_index[i+1]]
diff --git a/agreement/asyncVoteVerifier.go b/agreement/asyncVoteVerifier.go
index cb26b440eb..877c92dfb2 100644
--- a/agreement/asyncVoteVerifier.go
+++ b/agreement/asyncVoteVerifier.go
@@ -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
@@ -39,7 +39,7 @@ type asyncVerifyVoteRequest struct {
type asyncVerifyVoteResponse struct {
v vote
ev equivocationVote
- index int
+ index uint64
message message
err error
cancelled bool
@@ -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)!
@@ -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)!
diff --git a/agreement/bundle.go b/agreement/bundle.go
index 211f67b5b8..de297110ef 100644
--- a/agreement/bundle.go
+++ b/agreement/bundle.go
@@ -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
@@ -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) {
diff --git a/agreement/cadaver.go b/agreement/cadaver.go
index 7b0cb8e761..d3f626adaf 100644
--- a/agreement/cadaver.go
+++ b/agreement/cadaver.go
@@ -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 {
diff --git a/agreement/cryptoVerifier.go b/agreement/cryptoVerifier.go
index cf6c466e5d..ca4bceb666 100644
--- a/agreement/cryptoVerifier.go
+++ b/agreement/cryptoVerifier.go
@@ -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.
@@ -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
}
diff --git a/agreement/cryptoVerifier_test.go b/agreement/cryptoVerifier_test.go
index a42ffd9b0c..21b78c601e 100644
--- a/agreement/cryptoVerifier_test.go
+++ b/agreement/cryptoVerifier_test.go
@@ -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),
}
@@ -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,
@@ -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)))
@@ -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)
}
@@ -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,
},
@@ -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)
}
diff --git a/agreement/demux.go b/agreement/demux.go
index 7379590d50..ad51038b4e 100644
--- a/agreement/demux.go
+++ b/agreement/demux.go
@@ -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)
@@ -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})
@@ -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)
diff --git a/agreement/errors.go b/agreement/errors.go
index 606e433b64..eae272b9ff 100644
--- a/agreement/errors.go
+++ b/agreement/errors.go
@@ -16,38 +16,39 @@
package agreement
-import "fmt"
+import (
+ "fmt"
+)
// serializableError, or state machine error, is a serializable error that
// is correctly written to cadaver files.
-type serializableErrorUnderlying string
-type serializableError = *serializableErrorUnderlying
+type serializableError string
// implement error interface
-func (e serializableErrorUnderlying) Error() string {
+func (e serializableError) Error() string {
return string(e)
}
-func (e serializableErrorUnderlying) String() string {
+func (e serializableError) String() string {
return e.Error()
}
// makeSerErrStr returns an serializableError that formats as the given text.
-func makeSerErrStr(text string) serializableError {
- s := serializableErrorUnderlying(text)
+func makeSerErrStr(text string) *serializableError {
+ s := serializableError(text)
return &s
}
-func makeSerErrf(format string, a ...interface{}) serializableError {
- s := serializableErrorUnderlying(fmt.Sprintf(format, a...))
+func makeSerErrf(format string, a ...interface{}) *serializableError {
+ s := serializableError(fmt.Sprintf(format, a...))
return &s
}
// makeSerErr returns an serializableError that formats as the given error.
-func makeSerErr(err error) serializableError {
+func makeSerErr(err error) *serializableError {
if err == nil {
return nil
}
- s := serializableErrorUnderlying(err.Error())
+ s := serializableError(err.Error())
return &s
}
diff --git a/agreement/events.go b/agreement/events.go
index 61176872a6..f418cc38f4 100644
--- a/agreement/events.go
+++ b/agreement/events.go
@@ -43,7 +43,9 @@ type event interface {
// A ConsensusVersionView is a view of the consensus version as read from a
// LedgerReader, associated with some round.
type ConsensusVersionView struct {
- Err serializableError
+ _struct struct{} `codec:","`
+
+ Err *serializableError
Version protocol.ConsensusVersion
}
@@ -69,8 +71,7 @@ type externalEvent interface {
// type of the implementing struct.
//
//go:generate stringer -type=eventType
-//msgp:ignore eventType
-type eventType int
+type eventType uint8
const (
// none is returned by state machines which have no event to return
@@ -255,6 +256,7 @@ func (e emptyEvent) AttachConsensusVersion(v ConsensusVersionView) externalEvent
}
type messageEvent struct {
+ _struct struct{} `codec:","`
// {vote,bundle,payload}{Present,Verified}
T eventType
@@ -263,10 +265,10 @@ type messageEvent struct {
// Err is set if cryptographic verification was attempted and failed for
// Input.
- Err serializableError
+ Err *serializableError
// TaskIndex is optionally set to track a message as it is processed
// through cryptographic verification.
- TaskIndex int
+ TaskIndex uint64
// Tail is an optionally-set field which specifies an unauthenticated
// proposal which should be processed after Input is processed. Tail is
@@ -314,12 +316,15 @@ func (e messageEvent) AttachConsensusVersion(v ConsensusVersionView) externalEve
// freshnessData is bundled with filterableMessageEvent
// to allow for delegated freshness computation
type freshnessData struct {
+ _struct struct{} `codec:","`
+
PlayerRound round
PlayerPeriod period
PlayerStep step
PlayerLastConcluding step
}
+//msgp:ignore filterableMessageEvent
type filterableMessageEvent struct {
messageEvent
@@ -534,7 +539,7 @@ type payloadProcessedEvent struct {
// Err is set to be the reason the proposal payload was rejected in
// payloadRejected.
- Err serializableError
+ Err *serializableError
}
func (e payloadProcessedEvent) t() eventType {
@@ -558,7 +563,7 @@ type filteredEvent struct {
// Err is the reason cryptographic verification failed and is set for
// events {proposal,vote,bundle}Malformed.
- Err serializableError
+ Err *serializableError
}
func (e filteredEvent) t() eventType {
@@ -623,6 +628,7 @@ func (e pinnedValueEvent) ComparableStr() string {
}
type thresholdEvent struct {
+ _struct struct{} `codec:","`
// {{soft,cert,next}Threshold, none}
T eventType
@@ -818,6 +824,7 @@ func (e nextThresholdStatusRequestEvent) ComparableStr() string {
}
type nextThresholdStatusEvent struct {
+ _struct struct{} `codec:","`
// the result of a nextThresholdStatusRequest. Contains two bits of information,
// capturing four cases:
// Bottom = false, Proposal = unset/bottom --> received no next value thresholds
@@ -910,8 +917,8 @@ type checkpointEvent struct {
Round round
Period period
Step step
- Err serializableError // the error that was generated while storing the state to disk; nil on success.
- 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.
+ Err *serializableError // the error that was generated while storing the state to disk; nil on success.
+ 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.
}
func (e checkpointEvent) t() eventType {
diff --git a/agreement/events_test.go b/agreement/events_test.go
new file mode 100644
index 0000000000..243dd05089
--- /dev/null
+++ b/agreement/events_test.go
@@ -0,0 +1,88 @@
+// Copyright (C) 2019-2022 Algorand, Inc.
+// This file is part of go-algorand
+//
+// go-algorand is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// go-algorand is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with go-algorand. If not, see .
+
+package agreement
+
+import (
+ "encoding/base64"
+ "testing"
+
+ "github.com/algorand/go-algorand/protocol"
+ "github.com/stretchr/testify/require"
+)
+
+// TestSerializableErrorBackwardCompatible ensures Err field of type serializableError can be
+// properly decoded from ConsensusVersionView.
+// This test is only needed for agreement state serialization switch from reflection to msgp.
+func TestSerializableErrorBackwardCompatibility(t *testing.T) {
+
+ encodedEmpty, err := base64.StdEncoding.DecodeString("gqNFcnLAp1ZlcnNpb26jdjEw")
+ require.NoError(t, err)
+
+ encoded, err := base64.StdEncoding.DecodeString("gqNFcnKndGVzdGVycqdWZXJzaW9uo3YxMA==")
+ require.NoError(t, err)
+
+ // run on master f57a276 to get the encoded data for above
+ // cv := ConsensusVersionView{
+ // Err: nil,
+ // Version: protocol.ConsensusV10,
+ // }
+
+ // result := protocol.EncodeReflect(&cv)
+ // fmt.Println(base64.StdEncoding.EncodeToString(result))
+
+ // se := serializableErrorUnderlying("testerr")
+ // cv = ConsensusVersionView{
+ // Err: &se,
+ // Version: protocol.ConsensusV10,
+ // }
+
+ // result = protocol.EncodeReflect(&cv)
+ // fmt.Println(base64.StdEncoding.EncodeToString(result))
+
+ cvEmpty := ConsensusVersionView{
+ Err: nil,
+ Version: protocol.ConsensusV10,
+ }
+
+ se := serializableError("testerr")
+ cv := ConsensusVersionView{
+ Err: &se,
+ Version: protocol.ConsensusV10,
+ }
+
+ cv1 := ConsensusVersionView{}
+ err = protocol.Decode(encodedEmpty, &cv1)
+ require.NoError(t, err)
+
+ cv2 := ConsensusVersionView{}
+ err = protocol.DecodeReflect(encodedEmpty, &cv2)
+ require.NoError(t, err)
+
+ require.Equal(t, cv1, cv2)
+ require.Equal(t, cvEmpty, cv2)
+
+ cv1 = ConsensusVersionView{}
+ err = protocol.Decode(encoded, &cv1)
+ require.NoError(t, err)
+
+ cv2 = ConsensusVersionView{}
+ err = protocol.DecodeReflect(encoded, &cv2)
+ require.NoError(t, err)
+
+ require.Equal(t, cv1, cv2)
+ require.Equal(t, cv, cv2)
+}
diff --git a/agreement/eventtype_string.go b/agreement/eventtype_string.go
index f8ee701d80..9da84c1b98 100644
--- a/agreement/eventtype_string.go
+++ b/agreement/eventtype_string.go
@@ -54,7 +54,7 @@ const _eventType_name = "nonevotePresentpayloadPresentbundlePresentvoteVerifiedp
var _eventType_index = [...]uint16{0, 4, 15, 29, 42, 54, 69, 83, 100, 107, 118, 131, 144, 157, 176, 192, 204, 217, 231, 246, 261, 277, 293, 308, 322, 334, 342, 351, 362, 372, 389, 405, 431, 450, 471, 485, 501, 510, 523, 540}
func (i eventType) String() string {
- if i < 0 || i >= eventType(len(_eventType_index)-1) {
+ if i >= eventType(len(_eventType_index)-1) {
return "eventType(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _eventType_name[_eventType_index[i]:_eventType_index[i+1]]
diff --git a/agreement/message.go b/agreement/message.go
index 33a6d23ce0..a1f6a8c806 100644
--- a/agreement/message.go
+++ b/agreement/message.go
@@ -18,12 +18,20 @@ package agreement
import (
"github.com/algorand/go-algorand/protocol"
+ "github.com/algorand/msgp/msgp"
)
// A message represents an internal message which is passed between components
// of the agreement service.
type message struct {
- MessageHandle
+ _struct struct{} `codec:","`
+
+ // this field is for backwards compatibility with crash state serialized using go-codec prior to explicit unexport.
+ // should be removed after the next consensus update.
+ MessageHandle msgp.Raw
+ // explicitly unexport this field since we can't define serializers for interface{} type
+ // the only implementation of this is gossip.messageMetadata which doesn't have exported fields to serialize.
+ messageHandle MessageHandle
Tag protocol.Tag
@@ -46,6 +54,8 @@ type message struct {
// These messages are concatenated as an optimization which prevents proposals
// from being dropped.
type compoundMessage struct {
+ _struct struct{} `codec:","`
+
Vote unauthenticatedVote
Proposal unauthenticatedProposal
}
diff --git a/agreement/message_test.go b/agreement/message_test.go
index 88c4b504b3..76209a5f91 100644
--- a/agreement/message_test.go
+++ b/agreement/message_test.go
@@ -17,6 +17,7 @@
package agreement
import (
+ "encoding/base64"
"testing"
"github.com/stretchr/testify/require"
@@ -24,7 +25,9 @@ import (
"github.com/algorand/go-algorand/crypto"
"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/data/committee"
+ "github.com/algorand/go-algorand/network"
"github.com/algorand/go-algorand/protocol"
+ "github.com/algorand/go-algorand/test/partitiontest"
)
var poolAddr = basics.Address{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
@@ -80,3 +83,50 @@ func BenchmarkVoteDecoding(b *testing.B) {
decodeVote(msgBytes)
}
}
+
+// TestMessageBackwardCompatibility ensures MessageHandle field can be
+// properly decoded from message.
+// This test is only needed for agreement state serialization switch from reflection to msgp.
+func TestMessageBackwardCompatibility(t *testing.T) {
+ partitiontest.PartitionTest(t)
+
+ type messageMetadata struct {
+ raw network.IncomingMessage
+ }
+
+ encoded, err := base64.StdEncoding.DecodeString("iaZCdW5kbGWAr0NvbXBvdW5kTWVzc2FnZYKoUHJvcG9zYWyApFZvdGWArU1lc3NhZ2VIYW5kbGWAqFByb3Bvc2FsgKNUYWeiUFC1VW5hdXRoZW50aWNhdGVkQnVuZGxlgLdVbmF1dGhlbnRpY2F0ZWRQcm9wb3NhbICzVW5hdXRoZW50aWNhdGVkVm90ZYCkVm90ZYA=")
+ require.NoError(t, err)
+
+ // run on master f57a276 to get the encoded data for above
+ // msg := message{
+ // MessageHandle: &messageMetadata{raw: network.IncomingMessage{Tag: protocol.Tag("mytag"), Data: []byte("some data")}},
+ // Tag: protocol.ProposalPayloadTag,
+ // }
+
+ // result := protocol.EncodeReflect(&msg)
+ // fmt.Println(base64.StdEncoding.EncodeToString(result))
+
+ // messages for all rounds after this change should not have MessageHandle set so clearing it out and re-encoding/decoding it should yield this
+ targetMessage := message{
+ Tag: protocol.ProposalPayloadTag,
+ }
+
+ var m1, m2, m3, m4 message
+ // Both msgp and reflection should decode the message containing old MessageHandle successfully
+ err = protocol.Decode(encoded, &m1)
+ require.NoError(t, err)
+ err = protocol.DecodeReflect(encoded, &m2)
+ require.NoError(t, err)
+ // after setting MessageHandle to nil both should re-encode and decode to same values
+ m1.MessageHandle = nil
+ m2.MessageHandle = nil
+ e1 := protocol.Encode(&m1)
+ e2 := protocol.EncodeReflect(&m2)
+ require.Equal(t, e1, e2)
+ err = protocol.DecodeReflect(e1, &m3)
+ require.NoError(t, err)
+ err = protocol.Decode(e2, &m4)
+ require.NoError(t, err)
+ require.Equal(t, m3, m4)
+ require.Equal(t, m3, targetMessage)
+}
diff --git a/agreement/msgp_gen.go b/agreement/msgp_gen.go
index 4581b07a91..3c396226b8 100644
--- a/agreement/msgp_gen.go
+++ b/agreement/msgp_gen.go
@@ -22,6 +22,30 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// ConsensusVersionView
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// actionType
+// |-----> MarshalMsg
+// |-----> CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> Msgsize
+// |-----> MsgIsZero
+//
+// blockAssembler
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// bundle
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -30,6 +54,22 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// compoundMessage
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// diskState
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// equivocationVote
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -46,6 +86,46 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// eventType
+// |-----> MarshalMsg
+// |-----> CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> Msgsize
+// |-----> MsgIsZero
+//
+// freshnessData
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// message
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// messageEvent
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// nextThresholdStatusEvent
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// period
// |-----> MarshalMsg
// |-----> CanMarshalMsg
@@ -54,6 +134,22 @@ import (
// |-----> Msgsize
// |-----> MsgIsZero
//
+// periodRouter
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// player
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// proposal
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -62,6 +158,54 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// proposalManager
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// proposalSeeker
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// proposalStore
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// proposalTable
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// proposalTracker
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// proposalTrackerContract
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// proposalValue
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -70,6 +214,14 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// proposalVoteCounter
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// proposerSeed
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -86,6 +238,22 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// rootRouter
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// roundRouter
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// seedInput
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -102,13 +270,13 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
-// serializableErrorUnderlying
-// |-----> MarshalMsg
-// |-----> CanMarshalMsg
-// |-----> (*) UnmarshalMsg
-// |-----> (*) CanUnmarshalMsg
-// |-----> Msgsize
-// |-----> MsgIsZero
+// serializableError
+// |-----> MarshalMsg
+// |-----> CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> Msgsize
+// |-----> MsgIsZero
//
// step
// |-----> MarshalMsg
@@ -118,6 +286,22 @@ import (
// |-----> Msgsize
// |-----> MsgIsZero
//
+// stepRouter
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// thresholdEvent
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// transmittedPayload
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -166,6 +350,14 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// voteAggregator
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// voteAuthenticator
// |-----> (*) MarshalMsg
// |-----> (*) CanMarshalMsg
@@ -174,6 +366,38 @@ import (
// |-----> (*) Msgsize
// |-----> (*) MsgIsZero
//
+// voteTracker
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// voteTrackerContract
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// voteTrackerPeriod
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// voteTrackerRound
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
// MarshalMsg implements msgp.Marshaler
func (z *Certificate) MarshalMsg(b []byte) (o []byte) {
@@ -518,145 +742,307 @@ func (z *Certificate) MsgIsZero() bool {
}
// MarshalMsg implements msgp.Marshaler
-func (z *bundle) MarshalMsg(b []byte) (o []byte) {
+func (z *ConsensusVersionView) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0003Len := uint32(3)
- var zb0003Mask uint8 /* 4 bits */
- if len((*z).EquivocationVotes) == 0 {
- zb0003Len--
- zb0003Mask |= 0x2
- }
- if (*z).U.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x4
- }
- if len((*z).Votes) == 0 {
- zb0003Len--
- zb0003Mask |= 0x8
- }
- // variable map header, size zb0003Len
- o = append(o, 0x80|uint8(zb0003Len))
- if zb0003Len != 0 {
- if (zb0003Mask & 0x2) == 0 { // if not empty
- // string "eqv"
- o = append(o, 0xa3, 0x65, 0x71, 0x76)
- if (*z).EquivocationVotes == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendArrayHeader(o, uint32(len((*z).EquivocationVotes)))
- }
- for zb0002 := range (*z).EquivocationVotes {
- o = (*z).EquivocationVotes[zb0002].MarshalMsg(o)
- }
- }
- if (zb0003Mask & 0x4) == 0 { // if not empty
- // string "u"
- o = append(o, 0xa1, 0x75)
- o = (*z).U.MarshalMsg(o)
- }
- if (zb0003Mask & 0x8) == 0 { // if not empty
- // string "vote"
- o = append(o, 0xa4, 0x76, 0x6f, 0x74, 0x65)
- if (*z).Votes == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendArrayHeader(o, uint32(len((*z).Votes)))
- }
- for zb0001 := range (*z).Votes {
- o = (*z).Votes[zb0001].MarshalMsg(o)
- }
- }
+ // map header, size 2
+ // string "Err"
+ o = append(o, 0x82, 0xa3, 0x45, 0x72, 0x72)
+ if (*z).Err == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendString(o, string(*(*z).Err))
}
+ // string "Version"
+ o = append(o, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
+ o = (*z).Version.MarshalMsg(o)
return
}
-func (_ *bundle) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*bundle)
+func (_ *ConsensusVersionView) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*ConsensusVersionView)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *bundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *ConsensusVersionView) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
- var zb0003 int
- var zb0004 bool
- zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
if _, ok := err.(msgp.TypeError); ok {
- zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).U.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ (*z).Err = nil
+ } else {
+ if (*z).Err == nil {
+ (*z).Err = new(serializableError)
+ }
+ {
+ var zb0003 string
+ zb0003, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Err")
+ return
+ }
+ *(*z).Err = serializableError(zb0003)
+ }
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Version.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "U")
+ err = msgp.WrapError(err, "struct-from-array", "Version")
return
}
}
- if zb0003 > 0 {
- zb0003--
- var zb0005 int
- var zb0006 bool
- zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Votes")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
- if zb0005 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0005), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "struct-from-array", "Votes")
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = ConsensusVersionView{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
- if zb0006 {
- (*z).Votes = nil
- } else if (*z).Votes != nil && cap((*z).Votes) >= zb0005 {
- (*z).Votes = ((*z).Votes)[:zb0005]
- } else {
- (*z).Votes = make([]vote, zb0005)
- }
- for zb0001 := range (*z).Votes {
- bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
+ switch string(field) {
+ case "Err":
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ (*z).Err = nil
+ } else {
+ if (*z).Err == nil {
+ (*z).Err = new(serializableError)
+ }
+ {
+ var zb0004 string
+ zb0004, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Err")
+ return
+ }
+ *(*z).Err = serializableError(zb0004)
+ }
+ }
+ case "Version":
+ bts, err = (*z).Version.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Votes", zb0001)
+ err = msgp.WrapError(err, "Version")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
}
}
- if zb0003 > 0 {
- zb0003--
- var zb0007 int
- var zb0008 bool
- zb0007, zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ }
+ o = bts
+ return
+}
+
+func (_ *ConsensusVersionView) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*ConsensusVersionView)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *ConsensusVersionView) Msgsize() (s int) {
+ s = 1 + 4
+ if (*z).Err == nil {
+ s += msgp.NilSize
+ } else {
+ s += msgp.StringPrefixSize + len(string(*(*z).Err))
+ }
+ s += 8 + (*z).Version.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *ConsensusVersionView) MsgIsZero() bool {
+ return ((*z).Err == nil) && ((*z).Version.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z actionType) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ o = msgp.AppendUint8(o, uint8(z))
+ return
+}
+
+func (_ actionType) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(actionType)
+ if !ok {
+ _, ok = (z).(*actionType)
+ }
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *actionType) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ {
+ var zb0001 uint8
+ zb0001, bts, err = msgp.ReadUint8Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ (*z) = actionType(zb0001)
+ }
+ o = bts
+ return
+}
+
+func (_ *actionType) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*actionType)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z actionType) Msgsize() (s int) {
+ s = msgp.Uint8Size
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z actionType) MsgIsZero() bool {
+ return z == 0
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *blockAssembler) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 5
+ // string "Assembled"
+ o = append(o, 0x85, 0xa9, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64)
+ o = msgp.AppendBool(o, (*z).Assembled)
+ // string "Authenticators"
+ o = append(o, 0xae, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73)
+ if (*z).Authenticators == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).Authenticators)))
+ }
+ for zb0001 := range (*z).Authenticators {
+ o = (*z).Authenticators[zb0001].MarshalMsg(o)
+ }
+ // string "Filled"
+ o = append(o, 0xa6, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x64)
+ o = msgp.AppendBool(o, (*z).Filled)
+ // string "Payload"
+ o = append(o, 0xa7, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64)
+ o = (*z).Payload.MarshalMsg(o)
+ // string "Pipeline"
+ o = append(o, 0xa8, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65)
+ o = (*z).Pipeline.MarshalMsg(o)
+ return
+}
+
+func (_ *blockAssembler) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*blockAssembler)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *blockAssembler) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0002 int
+ var zb0003 bool
+ zb0002, zb0003, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0002, zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 > 0 {
+ zb0002--
+ bts, err = (*z).Pipeline.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
+ err = msgp.WrapError(err, "struct-from-array", "Pipeline")
return
}
- if zb0007 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0007), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
+ }
+ if zb0002 > 0 {
+ zb0002--
+ (*z).Filled, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Filled")
return
}
- if zb0008 {
- (*z).EquivocationVotes = nil
- } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0007 {
- (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0007]
+ }
+ if zb0002 > 0 {
+ zb0002--
+ bts, err = (*z).Payload.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Payload")
+ return
+ }
+ }
+ if zb0002 > 0 {
+ zb0002--
+ (*z).Assembled, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Assembled")
+ return
+ }
+ }
+ if zb0002 > 0 {
+ zb0002--
+ var zb0004 int
+ var zb0005 bool
+ zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Authenticators")
+ return
+ }
+ if zb0005 {
+ (*z).Authenticators = nil
+ } else if (*z).Authenticators != nil && cap((*z).Authenticators) >= zb0004 {
+ (*z).Authenticators = ((*z).Authenticators)[:zb0004]
} else {
- (*z).EquivocationVotes = make([]equivocationVote, zb0007)
+ (*z).Authenticators = make([]vote, zb0004)
}
- for zb0002 := range (*z).EquivocationVotes {
- bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
+ for zb0001 := range (*z).Authenticators {
+ bts, err = (*z).Authenticators[zb0001].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes", zb0002)
+ err = msgp.WrapError(err, "struct-from-array", "Authenticators", zb0001)
return
}
}
}
- if zb0003 > 0 {
- err = msgp.ErrTooManyArrayFields(zb0003)
+ if zb0002 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0002)
if err != nil {
err = msgp.WrapError(err, "struct-from-array")
return
@@ -667,74 +1053,60 @@ func (z *bundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
- if zb0004 {
- (*z) = bundle{}
+ if zb0003 {
+ (*z) = blockAssembler{}
}
- for zb0003 > 0 {
- zb0003--
+ for zb0002 > 0 {
+ zb0002--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch string(field) {
- case "u":
- bts, err = (*z).U.UnmarshalMsg(bts)
+ case "Pipeline":
+ bts, err = (*z).Pipeline.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "U")
+ err = msgp.WrapError(err, "Pipeline")
return
}
- case "vote":
- var zb0009 int
- var zb0010 bool
- zb0009, zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "Filled":
+ (*z).Filled, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Votes")
+ err = msgp.WrapError(err, "Filled")
return
}
- if zb0009 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0009), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "Votes")
+ case "Payload":
+ bts, err = (*z).Payload.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Payload")
return
}
- if zb0010 {
- (*z).Votes = nil
- } else if (*z).Votes != nil && cap((*z).Votes) >= zb0009 {
- (*z).Votes = ((*z).Votes)[:zb0009]
- } else {
- (*z).Votes = make([]vote, zb0009)
- }
- for zb0001 := range (*z).Votes {
- bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Votes", zb0001)
- return
- }
- }
- case "eqv":
- var zb0011 int
- var zb0012 bool
- zb0011, zb0012, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "Assembled":
+ (*z).Assembled, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "EquivocationVotes")
+ err = msgp.WrapError(err, "Assembled")
return
}
- if zb0011 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0011), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "EquivocationVotes")
+ case "Authenticators":
+ var zb0006 int
+ var zb0007 bool
+ zb0006, zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Authenticators")
return
}
- if zb0012 {
- (*z).EquivocationVotes = nil
- } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0011 {
- (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0011]
+ if zb0007 {
+ (*z).Authenticators = nil
+ } else if (*z).Authenticators != nil && cap((*z).Authenticators) >= zb0006 {
+ (*z).Authenticators = ((*z).Authenticators)[:zb0006]
} else {
- (*z).EquivocationVotes = make([]equivocationVote, zb0011)
+ (*z).Authenticators = make([]vote, zb0006)
}
- for zb0002 := range (*z).EquivocationVotes {
- bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
+ for zb0001 := range (*z).Authenticators {
+ bts, err = (*z).Authenticators[zb0001].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "EquivocationVotes", zb0002)
+ err = msgp.WrapError(err, "Authenticators", zb0001)
return
}
}
@@ -751,118 +1123,86 @@ func (z *bundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *bundle) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*bundle)
+func (_ *blockAssembler) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*blockAssembler)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *bundle) Msgsize() (s int) {
- s = 1 + 2 + (*z).U.Msgsize() + 5 + msgp.ArrayHeaderSize
- for zb0001 := range (*z).Votes {
- s += (*z).Votes[zb0001].Msgsize()
- }
- s += 4 + msgp.ArrayHeaderSize
- for zb0002 := range (*z).EquivocationVotes {
- s += (*z).EquivocationVotes[zb0002].Msgsize()
+func (z *blockAssembler) Msgsize() (s int) {
+ s = 1 + 9 + (*z).Pipeline.Msgsize() + 7 + msgp.BoolSize + 8 + (*z).Payload.Msgsize() + 10 + msgp.BoolSize + 15 + msgp.ArrayHeaderSize
+ for zb0001 := range (*z).Authenticators {
+ s += (*z).Authenticators[zb0001].Msgsize()
}
return
}
// MsgIsZero returns whether this is a zero value
-func (z *bundle) MsgIsZero() bool {
- return ((*z).U.MsgIsZero()) && (len((*z).Votes) == 0) && (len((*z).EquivocationVotes) == 0)
+func (z *blockAssembler) MsgIsZero() bool {
+ return ((*z).Pipeline.MsgIsZero()) && ((*z).Filled == false) && ((*z).Payload.MsgIsZero()) && ((*z).Assembled == false) && (len((*z).Authenticators) == 0)
}
// MarshalMsg implements msgp.Marshaler
-func (z *equivocationVote) MarshalMsg(b []byte) (o []byte) {
+func (z *bundle) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
// omitempty: check for empty values
- zb0003Len := uint32(7)
- var zb0003Mask uint8 /* 8 bits */
- if (*z).Cred.MsgIsZero() {
+ zb0003Len := uint32(3)
+ var zb0003Mask uint8 /* 4 bits */
+ if len((*z).EquivocationVotes) == 0 {
zb0003Len--
zb0003Mask |= 0x2
}
- if (*z).Period == 0 {
+ if (*z).U.MsgIsZero() {
zb0003Len--
zb0003Mask |= 0x4
}
- if ((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero()) {
+ if len((*z).Votes) == 0 {
zb0003Len--
zb0003Mask |= 0x8
}
- if (*z).Round.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x10
- }
- if ((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()) {
- zb0003Len--
- zb0003Mask |= 0x20
- }
- if (*z).Sender.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x40
- }
- if (*z).Step == 0 {
- zb0003Len--
- zb0003Mask |= 0x80
- }
// variable map header, size zb0003Len
o = append(o, 0x80|uint8(zb0003Len))
if zb0003Len != 0 {
if (zb0003Mask & 0x2) == 0 { // if not empty
- // string "cred"
- o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
- o = (*z).Cred.MarshalMsg(o)
+ // string "eqv"
+ o = append(o, 0xa3, 0x65, 0x71, 0x76)
+ if (*z).EquivocationVotes == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).EquivocationVotes)))
+ }
+ for zb0002 := range (*z).EquivocationVotes {
+ o = (*z).EquivocationVotes[zb0002].MarshalMsg(o)
+ }
}
if (zb0003Mask & 0x4) == 0 { // if not empty
- // string "per"
- o = append(o, 0xa3, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).Period))
+ // string "u"
+ o = append(o, 0xa1, 0x75)
+ o = (*z).U.MarshalMsg(o)
}
if (zb0003Mask & 0x8) == 0 { // if not empty
- // string "props"
- o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x70, 0x73)
- o = msgp.AppendArrayHeader(o, 2)
- for zb0001 := range (*z).Proposals {
- o = (*z).Proposals[zb0001].MarshalMsg(o)
+ // string "vote"
+ o = append(o, 0xa4, 0x76, 0x6f, 0x74, 0x65)
+ if (*z).Votes == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).Votes)))
}
- }
- if (zb0003Mask & 0x10) == 0 { // if not empty
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).Round.MarshalMsg(o)
- }
- if (zb0003Mask & 0x20) == 0 { // if not empty
- // string "sigs"
- o = append(o, 0xa4, 0x73, 0x69, 0x67, 0x73)
- o = msgp.AppendArrayHeader(o, 2)
- for zb0002 := range (*z).Sigs {
- o = (*z).Sigs[zb0002].MarshalMsg(o)
+ for zb0001 := range (*z).Votes {
+ o = (*z).Votes[zb0001].MarshalMsg(o)
}
}
- if (zb0003Mask & 0x40) == 0 { // if not empty
- // string "snd"
- o = append(o, 0xa3, 0x73, 0x6e, 0x64)
- o = (*z).Sender.MarshalMsg(o)
- }
- if (zb0003Mask & 0x80) == 0 { // if not empty
- // string "step"
- o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
- o = msgp.AppendUint64(o, uint64((*z).Step))
- }
}
return
}
-func (_ *equivocationVote) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*equivocationVote)
+func (_ *bundle) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*bundle)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *equivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *bundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0003 int
@@ -876,88 +1216,66 @@ func (z *equivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0003 > 0 {
zb0003--
- bts, err = (*z).Sender.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sender")
- return
- }
- }
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ bts, err = (*z).U.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
+ err = msgp.WrapError(err, "struct-from-array", "U")
return
}
}
if zb0003 > 0 {
zb0003--
- {
- var zb0005 uint64
- zb0005, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Period")
- return
- }
- (*z).Period = period(zb0005)
- }
- }
- if zb0003 > 0 {
- zb0003--
- {
- var zb0006 uint64
- zb0006, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Step")
- return
- }
- (*z).Step = step(zb0006)
- }
- }
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Cred")
+ err = msgp.WrapError(err, "struct-from-array", "Votes")
return
}
- }
- if zb0003 > 0 {
- zb0003--
- var zb0007 int
- zb0007, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposals")
+ if zb0005 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0005), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "struct-from-array", "Votes")
return
}
- if zb0007 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0007}
- return
+ if zb0006 {
+ (*z).Votes = nil
+ } else if (*z).Votes != nil && cap((*z).Votes) >= zb0005 {
+ (*z).Votes = ((*z).Votes)[:zb0005]
+ } else {
+ (*z).Votes = make([]vote, zb0005)
}
- for zb0001 := 0; zb0001 < zb0007; zb0001++ {
- bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
+ for zb0001 := range (*z).Votes {
+ bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposals", zb0001)
+ err = msgp.WrapError(err, "struct-from-array", "Votes", zb0001)
return
}
}
}
if zb0003 > 0 {
zb0003--
- var zb0008 int
- zb0008, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sigs")
+ err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
return
}
- if zb0008 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0008}
+ if zb0007 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0007), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
return
}
- for zb0002 := 0; zb0002 < zb0008; zb0002++ {
- bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
+ if zb0008 {
+ (*z).EquivocationVotes = nil
+ } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0007 {
+ (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0007]
+ } else {
+ (*z).EquivocationVotes = make([]equivocationVote, zb0007)
+ }
+ for zb0002 := range (*z).EquivocationVotes {
+ bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sigs", zb0002)
+ err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes", zb0002)
return
}
}
@@ -975,7 +1293,7 @@ func (z *equivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0004 {
- (*z) = equivocationVote{}
+ (*z) = bundle{}
}
for zb0003 > 0 {
zb0003--
@@ -985,77 +1303,63 @@ func (z *equivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "snd":
- bts, err = (*z).Sender.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sender")
- return
- }
- case "rnd":
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ case "u":
+ bts, err = (*z).U.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Round")
+ err = msgp.WrapError(err, "U")
return
}
- case "per":
- {
- var zb0009 uint64
- zb0009, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "Period")
- return
- }
- (*z).Period = period(zb0009)
- }
- case "step":
- {
- var zb0010 uint64
- zb0010, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "Step")
- return
- }
- (*z).Step = step(zb0010)
- }
- case "cred":
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ case "vote":
+ var zb0009 int
+ var zb0010 bool
+ zb0009, zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Cred")
+ err = msgp.WrapError(err, "Votes")
return
}
- case "props":
- var zb0011 int
- zb0011, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "Proposals")
+ if zb0009 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0009), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "Votes")
return
}
- if zb0011 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0011}
- return
+ if zb0010 {
+ (*z).Votes = nil
+ } else if (*z).Votes != nil && cap((*z).Votes) >= zb0009 {
+ (*z).Votes = ((*z).Votes)[:zb0009]
+ } else {
+ (*z).Votes = make([]vote, zb0009)
}
- for zb0001 := 0; zb0001 < zb0011; zb0001++ {
- bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
+ for zb0001 := range (*z).Votes {
+ bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Proposals", zb0001)
+ err = msgp.WrapError(err, "Votes", zb0001)
return
}
}
- case "sigs":
- var zb0012 int
- zb0012, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "eqv":
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Sigs")
+ err = msgp.WrapError(err, "EquivocationVotes")
return
}
- if zb0012 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0012}
+ if zb0011 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0011), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "EquivocationVotes")
return
}
- for zb0002 := 0; zb0002 < zb0012; zb0002++ {
- bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
+ if zb0012 {
+ (*z).EquivocationVotes = nil
+ } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0011 {
+ (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0011]
+ } else {
+ (*z).EquivocationVotes = make([]equivocationVote, zb0011)
+ }
+ for zb0002 := range (*z).EquivocationVotes {
+ bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Sigs", zb0002)
+ err = msgp.WrapError(err, "EquivocationVotes", zb0002)
return
}
}
@@ -1072,129 +1376,266 @@ func (z *equivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *equivocationVote) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*equivocationVote)
+func (_ *bundle) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*bundle)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *equivocationVote) Msgsize() (s int) {
- s = 1 + 4 + (*z).Sender.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Cred.Msgsize() + 6 + msgp.ArrayHeaderSize
- for zb0001 := range (*z).Proposals {
- s += (*z).Proposals[zb0001].Msgsize()
+func (z *bundle) Msgsize() (s int) {
+ s = 1 + 2 + (*z).U.Msgsize() + 5 + msgp.ArrayHeaderSize
+ for zb0001 := range (*z).Votes {
+ s += (*z).Votes[zb0001].Msgsize()
}
- s += 5 + msgp.ArrayHeaderSize
- for zb0002 := range (*z).Sigs {
- s += (*z).Sigs[zb0002].Msgsize()
+ s += 4 + msgp.ArrayHeaderSize
+ for zb0002 := range (*z).EquivocationVotes {
+ s += (*z).EquivocationVotes[zb0002].Msgsize()
}
return
}
// MsgIsZero returns whether this is a zero value
-func (z *equivocationVote) MsgIsZero() bool {
- return ((*z).Sender.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Cred.MsgIsZero()) && (((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero())) && (((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()))
+func (z *bundle) MsgIsZero() bool {
+ return ((*z).U.MsgIsZero()) && (len((*z).Votes) == 0) && (len((*z).EquivocationVotes) == 0)
}
// MarshalMsg implements msgp.Marshaler
-func (z *equivocationVoteAuthenticator) MarshalMsg(b []byte) (o []byte) {
+func (z *compoundMessage) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0003Len := uint32(4)
- // variable map header, size zb0003Len
- o = append(o, 0x80|uint8(zb0003Len))
- if zb0003Len != 0 {
- // string "cred"
- o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
- o = (*z).Cred.MarshalMsg(o)
- // string "props"
- o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x70, 0x73)
- o = msgp.AppendArrayHeader(o, 2)
- for zb0002 := range (*z).Proposals {
- o = (*z).Proposals[zb0002].MarshalMsg(o)
- }
- // string "sig"
- o = append(o, 0xa3, 0x73, 0x69, 0x67)
- o = msgp.AppendArrayHeader(o, 2)
- for zb0001 := range (*z).Sigs {
- o = (*z).Sigs[zb0001].MarshalMsg(o)
- }
- // string "snd"
- o = append(o, 0xa3, 0x73, 0x6e, 0x64)
- o = (*z).Sender.MarshalMsg(o)
- }
+ // map header, size 2
+ // string "Proposal"
+ o = append(o, 0x82, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).Proposal.MarshalMsg(o)
+ // string "Vote"
+ o = append(o, 0xa4, 0x56, 0x6f, 0x74, 0x65)
+ o = (*z).Vote.MarshalMsg(o)
return
}
-func (_ *equivocationVoteAuthenticator) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*equivocationVoteAuthenticator)
+func (_ *compoundMessage) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*compoundMessage)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *equivocationVoteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *compoundMessage) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
- var zb0003 int
- var zb0004 bool
- zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
if _, ok := err.(msgp.TypeError); ok {
- zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Vote.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sender")
+ err = msgp.WrapError(err, "struct-from-array", "Vote")
return
}
}
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Cred")
+ err = msgp.WrapError(err, "struct-from-array", "Proposal")
return
}
}
- if zb0003 > 0 {
- zb0003--
- var zb0005 int
- zb0005, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sigs")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
- if zb0005 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0005}
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = compoundMessage{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
- for zb0001 := 0; zb0001 < zb0005; zb0001++ {
- bts, err = (*z).Sigs[zb0001].UnmarshalMsg(bts)
+ switch string(field) {
+ case "Vote":
+ bts, err = (*z).Vote.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sigs", zb0001)
+ err = msgp.WrapError(err, "Vote")
+ return
+ }
+ case "Proposal":
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposal")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
}
}
+ }
+ o = bts
+ return
+}
+
+func (_ *compoundMessage) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*compoundMessage)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *compoundMessage) Msgsize() (s int) {
+ s = 1 + 5 + (*z).Vote.Msgsize() + 9 + (*z).Proposal.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *compoundMessage) MsgIsZero() bool {
+ return ((*z).Vote.MsgIsZero()) && ((*z).Proposal.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *diskState) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 5
+ // string "ActionTypes"
+ o = append(o, 0x85, 0xab, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73)
+ if (*z).ActionTypes == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).ActionTypes)))
+ }
+ for zb0001 := range (*z).ActionTypes {
+ o = msgp.AppendUint8(o, uint8((*z).ActionTypes[zb0001]))
+ }
+ // string "Actions"
+ o = append(o, 0xa7, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73)
+ if (*z).Actions == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).Actions)))
+ }
+ for zb0002 := range (*z).Actions {
+ o = msgp.AppendBytes(o, (*z).Actions[zb0002])
+ }
+ // string "Clock"
+ o = append(o, 0xa5, 0x43, 0x6c, 0x6f, 0x63, 0x6b)
+ o = msgp.AppendBytes(o, (*z).Clock)
+ // string "Player"
+ o = append(o, 0xa6, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72)
+ o = msgp.AppendBytes(o, (*z).Player)
+ // string "Router"
+ o = append(o, 0xa6, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72)
+ o = msgp.AppendBytes(o, (*z).Router)
+ return
+}
+
+func (_ *diskState) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*diskState)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *diskState) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ (*z).Router, bts, err = msgp.ReadBytesBytes(bts, (*z).Router)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Router")
+ return
+ }
+ }
if zb0003 > 0 {
zb0003--
- var zb0006 int
- zb0006, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ (*z).Player, bts, err = msgp.ReadBytesBytes(bts, (*z).Player)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposals")
+ err = msgp.WrapError(err, "struct-from-array", "Player")
return
}
- if zb0006 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0006}
+ }
+ if zb0003 > 0 {
+ zb0003--
+ (*z).Clock, bts, err = msgp.ReadBytesBytes(bts, (*z).Clock)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Clock")
return
}
- for zb0002 := 0; zb0002 < zb0006; zb0002++ {
- bts, err = (*z).Proposals[zb0002].UnmarshalMsg(bts)
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ActionTypes")
+ return
+ }
+ if zb0006 {
+ (*z).ActionTypes = nil
+ } else if (*z).ActionTypes != nil && cap((*z).ActionTypes) >= zb0005 {
+ (*z).ActionTypes = ((*z).ActionTypes)[:zb0005]
+ } else {
+ (*z).ActionTypes = make([]actionType, zb0005)
+ }
+ for zb0001 := range (*z).ActionTypes {
+ {
+ var zb0007 uint8
+ zb0007, bts, err = msgp.ReadUint8Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ActionTypes", zb0001)
+ return
+ }
+ (*z).ActionTypes[zb0001] = actionType(zb0007)
+ }
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0008 int
+ var zb0009 bool
+ zb0008, zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Actions")
+ return
+ }
+ if zb0009 {
+ (*z).Actions = nil
+ } else if (*z).Actions != nil && cap((*z).Actions) >= zb0008 {
+ (*z).Actions = ((*z).Actions)[:zb0008]
+ } else {
+ (*z).Actions = make([][]byte, zb0008)
+ }
+ for zb0002 := range (*z).Actions {
+ (*z).Actions[zb0002], bts, err = msgp.ReadBytesBytes(bts, (*z).Actions[zb0002])
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposals", zb0002)
+ err = msgp.WrapError(err, "struct-from-array", "Actions", zb0002)
return
}
}
@@ -1212,7 +1653,7 @@ func (z *equivocationVoteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err
return
}
if zb0004 {
- (*z) = equivocationVoteAuthenticator{}
+ (*z) = diskState{}
}
for zb0003 > 0 {
zb0003--
@@ -1222,51 +1663,69 @@ func (z *equivocationVoteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err
return
}
switch string(field) {
- case "snd":
- bts, err = (*z).Sender.UnmarshalMsg(bts)
+ case "Router":
+ (*z).Router, bts, err = msgp.ReadBytesBytes(bts, (*z).Router)
if err != nil {
- err = msgp.WrapError(err, "Sender")
+ err = msgp.WrapError(err, "Router")
return
}
- case "cred":
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ case "Player":
+ (*z).Player, bts, err = msgp.ReadBytesBytes(bts, (*z).Player)
if err != nil {
- err = msgp.WrapError(err, "Cred")
+ err = msgp.WrapError(err, "Player")
return
}
- case "sig":
- var zb0007 int
- zb0007, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "Clock":
+ (*z).Clock, bts, err = msgp.ReadBytesBytes(bts, (*z).Clock)
if err != nil {
- err = msgp.WrapError(err, "Sigs")
+ err = msgp.WrapError(err, "Clock")
return
}
- if zb0007 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0007}
+ case "ActionTypes":
+ var zb0010 int
+ var zb0011 bool
+ zb0010, zb0011, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ActionTypes")
return
}
- for zb0001 := 0; zb0001 < zb0007; zb0001++ {
- bts, err = (*z).Sigs[zb0001].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sigs", zb0001)
- return
+ if zb0011 {
+ (*z).ActionTypes = nil
+ } else if (*z).ActionTypes != nil && cap((*z).ActionTypes) >= zb0010 {
+ (*z).ActionTypes = ((*z).ActionTypes)[:zb0010]
+ } else {
+ (*z).ActionTypes = make([]actionType, zb0010)
+ }
+ for zb0001 := range (*z).ActionTypes {
+ {
+ var zb0012 uint8
+ zb0012, bts, err = msgp.ReadUint8Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ActionTypes", zb0001)
+ return
+ }
+ (*z).ActionTypes[zb0001] = actionType(zb0012)
}
}
- case "props":
- var zb0008 int
- zb0008, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "Actions":
+ var zb0013 int
+ var zb0014 bool
+ zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Proposals")
+ err = msgp.WrapError(err, "Actions")
return
}
- if zb0008 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0008}
- return
+ if zb0014 {
+ (*z).Actions = nil
+ } else if (*z).Actions != nil && cap((*z).Actions) >= zb0013 {
+ (*z).Actions = ((*z).Actions)[:zb0013]
+ } else {
+ (*z).Actions = make([][]byte, zb0013)
}
- for zb0002 := 0; zb0002 < zb0008; zb0002++ {
- bts, err = (*z).Proposals[zb0002].UnmarshalMsg(bts)
+ for zb0002 := range (*z).Actions {
+ (*z).Actions[zb0002], bts, err = msgp.ReadBytesBytes(bts, (*z).Actions[zb0002])
if err != nil {
- err = msgp.WrapError(err, "Proposals", zb0002)
+ err = msgp.WrapError(err, "Actions", zb0002)
return
}
}
@@ -1283,676 +1742,686 @@ func (z *equivocationVoteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err
return
}
-func (_ *equivocationVoteAuthenticator) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*equivocationVoteAuthenticator)
+func (_ *diskState) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*diskState)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *equivocationVoteAuthenticator) Msgsize() (s int) {
- s = 1 + 4 + (*z).Sender.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + msgp.ArrayHeaderSize
- for zb0001 := range (*z).Sigs {
- s += (*z).Sigs[zb0001].Msgsize()
- }
- s += 6 + msgp.ArrayHeaderSize
- for zb0002 := range (*z).Proposals {
- s += (*z).Proposals[zb0002].Msgsize()
- }
- return
-}
-
-// MsgIsZero returns whether this is a zero value
-func (z *equivocationVoteAuthenticator) MsgIsZero() bool {
- return ((*z).Sender.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && (((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero())) && (((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero()))
-}
-
-// MarshalMsg implements msgp.Marshaler
-func (z period) MarshalMsg(b []byte) (o []byte) {
- o = msgp.Require(b, z.Msgsize())
- o = msgp.AppendUint64(o, uint64(z))
- return
-}
-
-func (_ period) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(period)
- if !ok {
- _, ok = (z).(*period)
- }
- return ok
-}
-
-// UnmarshalMsg implements msgp.Unmarshaler
-func (z *period) UnmarshalMsg(bts []byte) (o []byte, err error) {
- {
- var zb0001 uint64
- zb0001, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
- (*z) = period(zb0001)
+func (z *diskState) Msgsize() (s int) {
+ s = 1 + 7 + msgp.BytesPrefixSize + len((*z).Router) + 7 + msgp.BytesPrefixSize + len((*z).Player) + 6 + msgp.BytesPrefixSize + len((*z).Clock) + 12 + msgp.ArrayHeaderSize + (len((*z).ActionTypes) * (msgp.Uint8Size)) + 8 + msgp.ArrayHeaderSize
+ for zb0002 := range (*z).Actions {
+ s += msgp.BytesPrefixSize + len((*z).Actions[zb0002])
}
- o = bts
- return
-}
-
-func (_ *period) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*period)
- return ok
-}
-
-// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z period) Msgsize() (s int) {
- s = msgp.Uint64Size
return
}
// MsgIsZero returns whether this is a zero value
-func (z period) MsgIsZero() bool {
- return z == 0
+func (z *diskState) MsgIsZero() bool {
+ return (len((*z).Router) == 0) && (len((*z).Player) == 0) && (len((*z).Clock) == 0) && (len((*z).ActionTypes) == 0) && (len((*z).Actions) == 0)
}
// MarshalMsg implements msgp.Marshaler
-func (z *proposal) MarshalMsg(b []byte) (o []byte) {
+func (z *equivocationVote) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
// omitempty: check for empty values
- zb0004Len := uint32(29)
- var zb0004Mask uint64 /* 38 bits */
- if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0 {
- zb0004Len--
- zb0004Mask |= 0x40
+ zb0003Len := uint32(7)
+ var zb0003Mask uint8 /* 8 bits */
+ if (*z).Cred.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x2
}
- if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x80
+ if (*z).Period == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x4
}
- if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0 {
- zb0004Len--
- zb0004Mask |= 0x100
+ if ((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero()) {
+ zb0003Len--
+ zb0003Mask |= 0x8
}
- if (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "" {
- zb0004Len--
- zb0004Mask |= 0x200
+ if (*z).Round.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x10
}
- if (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x400
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x800
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x1000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x2000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0 {
- zb0004Len--
- zb0004Mask |= 0x4000
- }
- if (*z).unauthenticatedProposal.OriginalPeriod == 0 {
- zb0004Len--
- zb0004Mask |= 0x8000
- }
- if (*z).unauthenticatedProposal.OriginalProposer.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x10000
- }
- if len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0 {
- zb0004Len--
- zb0004Mask |= 0x20000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x40000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x80000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0 {
- zb0004Len--
- zb0004Mask |= 0x100000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x400000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x800000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x1000000
- }
- if (*z).unauthenticatedProposal.SeedProof.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x2000000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x4000000
- }
- if len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0 {
- zb0004Len--
- zb0004Mask |= 0x8000000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0 {
- zb0004Len--
- zb0004Mask |= 0x10000000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0 {
- zb0004Len--
- zb0004Mask |= 0x20000000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x40000000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x80000000
- }
- if (*z).unauthenticatedProposal.Block.Payset.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x100000000
- }
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x200000000
+ if ((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()) {
+ zb0003Len--
+ zb0003Mask |= 0x20
}
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x400000000
+ if (*z).Sender.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x40
}
- if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false {
- zb0004Len--
- zb0004Mask |= 0x800000000
+ if (*z).Step == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x80
}
- // variable map header, size zb0004Len
- o = msgp.AppendMapHeader(o, zb0004Len)
- if zb0004Len != 0 {
- if (zb0004Mask & 0x40) == 0 { // if not empty
- // string "earn"
- o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e)
- o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel)
- }
- if (zb0004Mask & 0x80) == 0 { // if not empty
- // string "fees"
- o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MarshalMsg(o)
+ // variable map header, size zb0003Len
+ o = append(o, 0x80|uint8(zb0003Len))
+ if zb0003Len != 0 {
+ if (zb0003Mask & 0x2) == 0 { // if not empty
+ // string "cred"
+ o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
+ o = (*z).Cred.MarshalMsg(o)
}
- if (zb0004Mask & 0x100) == 0 { // if not empty
- // string "frac"
- o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63)
- o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue)
+ if (zb0003Mask & 0x4) == 0 { // if not empty
+ // string "per"
+ o = append(o, 0xa3, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
}
- if (zb0004Mask & 0x200) == 0 { // if not empty
- // string "gen"
- o = append(o, 0xa3, 0x67, 0x65, 0x6e)
- o = msgp.AppendString(o, (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID)
+ if (zb0003Mask & 0x8) == 0 { // if not empty
+ // string "props"
+ o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x70, 0x73)
+ o = msgp.AppendArrayHeader(o, 2)
+ for zb0001 := range (*z).Proposals {
+ o = (*z).Proposals[zb0001].MarshalMsg(o)
+ }
}
- if (zb0004Mask & 0x400) == 0 { // if not empty
- // string "gh"
- o = append(o, 0xa2, 0x67, 0x68)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MarshalMsg(o)
+ if (zb0003Mask & 0x10) == 0 { // if not empty
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
}
- if (zb0004Mask & 0x800) == 0 { // if not empty
- // string "nextbefore"
- o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MarshalMsg(o)
+ if (zb0003Mask & 0x20) == 0 { // if not empty
+ // string "sigs"
+ o = append(o, 0xa4, 0x73, 0x69, 0x67, 0x73)
+ o = msgp.AppendArrayHeader(o, 2)
+ for zb0002 := range (*z).Sigs {
+ o = (*z).Sigs[zb0002].MarshalMsg(o)
+ }
}
- if (zb0004Mask & 0x1000) == 0 { // if not empty
- // string "nextproto"
- o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MarshalMsg(o)
+ if (zb0003Mask & 0x40) == 0 { // if not empty
+ // string "snd"
+ o = append(o, 0xa3, 0x73, 0x6e, 0x64)
+ o = (*z).Sender.MarshalMsg(o)
}
- if (zb0004Mask & 0x2000) == 0 { // if not empty
- // string "nextswitch"
- o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MarshalMsg(o)
+ if (zb0003Mask & 0x80) == 0 { // if not empty
+ // string "step"
+ o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
}
- if (zb0004Mask & 0x4000) == 0 { // if not empty
- // string "nextyes"
- o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73)
- o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals)
+ }
+ return
+}
+
+func (_ *equivocationVote) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*equivocationVote)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *equivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if (zb0004Mask & 0x8000) == 0 { // if not empty
- // string "oper"
- o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).unauthenticatedProposal.OriginalPeriod))
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sender")
+ return
+ }
}
- if (zb0004Mask & 0x10000) == 0 { // if not empty
- // string "oprop"
- o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).unauthenticatedProposal.OriginalProposer.MarshalMsg(o)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
}
- if (zb0004Mask & 0x20000) == 0 { // if not empty
- // string "partupdrmv"
- o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76)
- if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendArrayHeader(o, uint32(len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)))
+ if zb0003 > 0 {
+ zb0003--
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0005)
}
- for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- o = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o)
+ }
+ if zb0003 > 0 {
+ zb0003--
+ {
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0006)
}
}
- if (zb0004Mask & 0x40000) == 0 { // if not empty
- // string "prev"
- o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.MarshalMsg(o)
- }
- if (zb0004Mask & 0x80000) == 0 { // if not empty
- // string "proto"
- o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MarshalMsg(o)
- }
- if (zb0004Mask & 0x100000) == 0 { // if not empty
- // string "rate"
- o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65)
- o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate)
- }
- if (zb0004Mask & 0x400000) == 0 { // if not empty
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.Round.MarshalMsg(o)
- }
- if (zb0004Mask & 0x800000) == 0 { // if not empty
- // string "rwcalr"
- o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MarshalMsg(o)
- }
- if (zb0004Mask & 0x1000000) == 0 { // if not empty
- // string "rwd"
- o = append(o, 0xa3, 0x72, 0x77, 0x64)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MarshalMsg(o)
- }
- if (zb0004Mask & 0x2000000) == 0 { // if not empty
- // string "sdpf"
- o = append(o, 0xa4, 0x73, 0x64, 0x70, 0x66)
- o = (*z).unauthenticatedProposal.SeedProof.MarshalMsg(o)
- }
- if (zb0004Mask & 0x4000000) == 0 { // if not empty
- // string "seed"
- o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.MarshalMsg(o)
- }
- if (zb0004Mask & 0x8000000) == 0 { // if not empty
- // string "spt"
- o = append(o, 0xa3, 0x73, 0x70, 0x74)
- if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendMapHeader(o, uint32(len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking)))
- }
- zb0001_keys := make([]protocol.StateProofType, 0, len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking))
- for zb0001 := range (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking {
- zb0001_keys = append(zb0001_keys, zb0001)
- }
- sort.Sort(protocol.SortStateProofType(zb0001_keys))
- for _, zb0001 := range zb0001_keys {
- zb0002 := (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking[zb0001]
- _ = zb0002
- o = zb0001.MarshalMsg(o)
- o = zb0002.MarshalMsg(o)
- }
- }
- if (zb0004Mask & 0x10000000) == 0 { // if not empty
- // string "tc"
- o = append(o, 0xa2, 0x74, 0x63)
- o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter)
- }
- if (zb0004Mask & 0x20000000) == 0 { // if not empty
- // string "ts"
- o = append(o, 0xa2, 0x74, 0x73)
- o = msgp.AppendInt64(o, (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp)
- }
- if (zb0004Mask & 0x40000000) == 0 { // if not empty
- // string "txn"
- o = append(o, 0xa3, 0x74, 0x78, 0x6e)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MarshalMsg(o)
- }
- if (zb0004Mask & 0x80000000) == 0 { // if not empty
- // string "txn256"
- o = append(o, 0xa6, 0x74, 0x78, 0x6e, 0x32, 0x35, 0x36)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MarshalMsg(o)
- }
- if (zb0004Mask & 0x100000000) == 0 { // if not empty
- // string "txns"
- o = append(o, 0xa4, 0x74, 0x78, 0x6e, 0x73)
- o = (*z).unauthenticatedProposal.Block.Payset.MarshalMsg(o)
- }
- if (zb0004Mask & 0x200000000) == 0 { // if not empty
- // string "upgradedelay"
- o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MarshalMsg(o)
- }
- if (zb0004Mask & 0x400000000) == 0 { // if not empty
- // string "upgradeprop"
- o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MarshalMsg(o)
- }
- if (zb0004Mask & 0x800000000) == 0 { // if not empty
- // string "upgradeyes"
- o = append(o, 0xaa, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x79, 0x65, 0x73)
- o = msgp.AppendBool(o, (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove)
- }
- }
- return
-}
-
-func (_ *proposal) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*proposal)
- return ok
-}
-
-// UnmarshalMsg implements msgp.Unmarshaler
-func (z *proposal) UnmarshalMsg(bts []byte) (o []byte, err error) {
- var field []byte
- _ = field
- var zb0004 int
- var zb0005 bool
- zb0004, zb0005, bts, err = msgp.ReadMapHeaderBytes(bts)
- if _, ok := err.(msgp.TypeError); ok {
- zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts)
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Round.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Branch")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Seed")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NativeSha512_256Commitment")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sha256Commitment")
+ err = msgp.WrapError(err, "struct-from-array", "Cred")
return
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
+ if zb0003 > 0 {
+ zb0003--
+ var zb0007 int
+ zb0007, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "TimeStamp")
+ err = msgp.WrapError(err, "struct-from-array", "Proposals")
return
}
- }
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "GenesisID")
+ if zb0007 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0007}
return
}
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "GenesisHash")
- return
+ for zb0001 := 0; zb0001 < zb0007; zb0001++ {
+ bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposals", zb0001)
+ return
+ }
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
+ if zb0003 > 0 {
+ zb0003--
+ var zb0008 int
+ zb0008, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "FeeSink")
+ err = msgp.WrapError(err, "struct-from-array", "Sigs")
return
}
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsPool")
+ if zb0008 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0008}
return
}
- }
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsLevel")
- return
+ for zb0002 := 0; zb0002 < zb0008; zb0002++ {
+ bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sigs", zb0002)
+ return
+ }
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsRate")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsResidue")
- return
- }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsRecalculationRound")
- return
- }
+ if zb0004 {
+ (*z) = equivocationVote{}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "CurrentProtocol")
+ err = msgp.WrapError(err)
return
}
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocol")
- return
+ switch string(field) {
+ case "snd":
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sender")
+ return
+ }
+ case "rnd":
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "per":
+ {
+ var zb0009 uint64
+ zb0009, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Period")
+ return
+ }
+ (*z).Period = period(zb0009)
+ }
+ case "step":
+ {
+ var zb0010 uint64
+ zb0010, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0010)
+ }
+ case "cred":
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cred")
+ return
+ }
+ case "props":
+ var zb0011 int
+ zb0011, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposals")
+ return
+ }
+ if zb0011 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0011}
+ return
+ }
+ for zb0001 := 0; zb0001 < zb0011; zb0001++ {
+ bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposals", zb0001)
+ return
+ }
+ }
+ case "sigs":
+ var zb0012 int
+ zb0012, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sigs")
+ return
+ }
+ if zb0012 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0012}
+ return
+ }
+ for zb0002 := 0; zb0002 < zb0012; zb0002++ {
+ bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sigs", zb0002)
+ return
+ }
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocolApprovals")
- return
- }
+ }
+ o = bts
+ return
+}
+
+func (_ *equivocationVote) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*equivocationVote)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *equivocationVote) Msgsize() (s int) {
+ s = 1 + 4 + (*z).Sender.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Cred.Msgsize() + 6 + msgp.ArrayHeaderSize
+ for zb0001 := range (*z).Proposals {
+ s += (*z).Proposals[zb0001].Msgsize()
+ }
+ s += 5 + msgp.ArrayHeaderSize
+ for zb0002 := range (*z).Sigs {
+ s += (*z).Sigs[zb0002].Msgsize()
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *equivocationVote) MsgIsZero() bool {
+ return ((*z).Sender.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Cred.MsgIsZero()) && (((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero())) && (((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()))
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *equivocationVoteAuthenticator) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0003Len := uint32(4)
+ // variable map header, size zb0003Len
+ o = append(o, 0x80|uint8(zb0003Len))
+ if zb0003Len != 0 {
+ // string "cred"
+ o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
+ o = (*z).Cred.MarshalMsg(o)
+ // string "props"
+ o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x70, 0x73)
+ o = msgp.AppendArrayHeader(o, 2)
+ for zb0002 := range (*z).Proposals {
+ o = (*z).Proposals[zb0002].MarshalMsg(o)
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocolVoteBefore")
- return
- }
+ // string "sig"
+ o = append(o, 0xa3, 0x73, 0x69, 0x67)
+ o = msgp.AppendArrayHeader(o, 2)
+ for zb0001 := range (*z).Sigs {
+ o = (*z).Sigs[zb0001].MarshalMsg(o)
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocolSwitchOn")
- return
- }
+ // string "snd"
+ o = append(o, 0xa3, 0x73, 0x6e, 0x64)
+ o = (*z).Sender.MarshalMsg(o)
+ }
+ return
+}
+
+func (_ *equivocationVoteAuthenticator) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*equivocationVoteAuthenticator)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *equivocationVoteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "UpgradePropose")
+ err = msgp.WrapError(err, "struct-from-array", "Sender")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "UpgradeDelay")
+ err = msgp.WrapError(err, "struct-from-array", "Cred")
return
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ zb0005, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "UpgradeApprove")
+ err = msgp.WrapError(err, "struct-from-array", "Sigs")
return
}
- }
- if zb0004 > 0 {
- zb0004--
- (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "TxnCounter")
+ if zb0005 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0005}
return
}
+ for zb0001 := 0; zb0001 < zb0005; zb0001++ {
+ bts, err = (*z).Sigs[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sigs", zb0001)
+ return
+ }
+ }
}
- if zb0004 > 0 {
- zb0004--
+ if zb0003 > 0 {
+ zb0003--
var zb0006 int
- var zb0007 bool
- zb0006, zb0007, bts, err = msgp.ReadMapHeaderBytes(bts)
+ zb0006, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ err = msgp.WrapError(err, "struct-from-array", "Proposals")
return
}
- if zb0006 > protocol.NumStateProofTypes {
- err = msgp.ErrOverflow(uint64(zb0006), uint64(protocol.NumStateProofTypes))
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ if zb0006 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0006}
return
}
- if zb0007 {
- (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = nil
- } else if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
- (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0006)
- }
- for zb0006 > 0 {
- var zb0001 protocol.StateProofType
- var zb0002 bookkeeping.StateProofTrackingData
- zb0006--
- bts, err = zb0001.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
- return
- }
- bts, err = zb0002.UnmarshalMsg(bts)
+ for zb0002 := 0; zb0002 < zb0006; zb0002++ {
+ bts, err = (*z).Proposals[zb0002].UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking", zb0001)
+ err = msgp.WrapError(err, "struct-from-array", "Proposals", zb0002)
return
}
- (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking[zb0001] = zb0002
}
}
- if zb0004 > 0 {
- zb0004--
- var zb0008 int
- var zb0009 bool
- zb0008, zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
- if zb0008 > config.MaxProposedExpiredOnlineAccounts {
- err = msgp.ErrOverflow(uint64(zb0008), uint64(config.MaxProposedExpiredOnlineAccounts))
- err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 {
+ (*z) = equivocationVoteAuthenticator{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
- if zb0009 {
- (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
- } else if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0008 {
- (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0008]
- } else {
- (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0008)
- }
- for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ switch string(field) {
+ case "snd":
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts", zb0003)
+ err = msgp.WrapError(err, "Sender")
+ return
+ }
+ case "cred":
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cred")
+ return
+ }
+ case "sig":
+ var zb0007 int
+ zb0007, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sigs")
+ return
+ }
+ if zb0007 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0007}
+ return
+ }
+ for zb0001 := 0; zb0001 < zb0007; zb0001++ {
+ bts, err = (*z).Sigs[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sigs", zb0001)
+ return
+ }
+ }
+ case "props":
+ var zb0008 int
+ zb0008, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposals")
+ return
+ }
+ if zb0008 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0008}
+ return
+ }
+ for zb0002 := 0; zb0002 < zb0008; zb0002++ {
+ bts, err = (*z).Proposals[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposals", zb0002)
+ return
+ }
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.Block.Payset.UnmarshalMsg(bts)
+ }
+ o = bts
+ return
+}
+
+func (_ *equivocationVoteAuthenticator) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*equivocationVoteAuthenticator)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *equivocationVoteAuthenticator) Msgsize() (s int) {
+ s = 1 + 4 + (*z).Sender.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + msgp.ArrayHeaderSize
+ for zb0001 := range (*z).Sigs {
+ s += (*z).Sigs[zb0001].Msgsize()
+ }
+ s += 6 + msgp.ArrayHeaderSize
+ for zb0002 := range (*z).Proposals {
+ s += (*z).Proposals[zb0002].Msgsize()
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *equivocationVoteAuthenticator) MsgIsZero() bool {
+ return ((*z).Sender.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && (((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero())) && (((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero()))
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z eventType) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ o = msgp.AppendUint8(o, uint8(z))
+ return
+}
+
+func (_ eventType) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(eventType)
+ if !ok {
+ _, ok = (z).(*eventType)
+ }
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *eventType) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ {
+ var zb0001 uint8
+ zb0001, bts, err = msgp.ReadUint8Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ (*z) = eventType(zb0001)
+ }
+ o = bts
+ return
+}
+
+func (_ *eventType) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*eventType)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z eventType) Msgsize() (s int) {
+ s = msgp.Uint8Size
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z eventType) MsgIsZero() bool {
+ return z == 0
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *freshnessData) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 4
+ // string "PlayerLastConcluding"
+ o = append(o, 0x84, 0xb4, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67)
+ o = msgp.AppendUint64(o, uint64((*z).PlayerLastConcluding))
+ // string "PlayerPeriod"
+ o = append(o, 0xac, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64)
+ o = msgp.AppendUint64(o, uint64((*z).PlayerPeriod))
+ // string "PlayerRound"
+ o = append(o, 0xab, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x6f, 0x75, 0x6e, 0x64)
+ o = (*z).PlayerRound.MarshalMsg(o)
+ // string "PlayerStep"
+ o = append(o, 0xaa, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).PlayerStep))
+ return
+}
+
+func (_ *freshnessData) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*freshnessData)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *freshnessData) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).PlayerRound.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Payset")
+ err = msgp.WrapError(err, "struct-from-array", "PlayerRound")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.SeedProof.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "SeedProof")
- return
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0003 uint64
+ zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "PlayerPeriod")
+ return
+ }
+ (*z).PlayerPeriod = period(zb0003)
}
}
- if zb0004 > 0 {
- zb0004--
+ if zb0001 > 0 {
+ zb0001--
{
- var zb0010 uint64
- zb0010, bts, err = msgp.ReadUint64Bytes(bts)
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "OriginalPeriod")
+ err = msgp.WrapError(err, "struct-from-array", "PlayerStep")
return
}
- (*z).unauthenticatedProposal.OriginalPeriod = period(zb0010)
+ (*z).PlayerStep = step(zb0004)
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).unauthenticatedProposal.OriginalProposer.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "OriginalProposer")
- return
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "PlayerLastConcluding")
+ return
+ }
+ (*z).PlayerLastConcluding = step(zb0005)
}
}
- if zb0004 > 0 {
- err = msgp.ErrTooManyArrayFields(zb0004)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
err = msgp.WrapError(err, "struct-from-array")
return
@@ -1963,248 +2432,421 @@ func (z *proposal) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
- if zb0005 {
- (*z) = proposal{}
+ if zb0002 {
+ (*z) = freshnessData{}
}
- for zb0004 > 0 {
- zb0004--
+ for zb0001 > 0 {
+ zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch string(field) {
- case "rnd":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Round.UnmarshalMsg(bts)
+ case "PlayerRound":
+ bts, err = (*z).PlayerRound.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Round")
+ err = msgp.WrapError(err, "PlayerRound")
return
}
- case "prev":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Branch")
- return
+ case "PlayerPeriod":
+ {
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "PlayerPeriod")
+ return
+ }
+ (*z).PlayerPeriod = period(zb0006)
}
- case "seed":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.UnmarshalMsg(bts)
+ case "PlayerStep":
+ {
+ var zb0007 uint64
+ zb0007, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "PlayerStep")
+ return
+ }
+ (*z).PlayerStep = step(zb0007)
+ }
+ case "PlayerLastConcluding":
+ {
+ var zb0008 uint64
+ zb0008, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "PlayerLastConcluding")
+ return
+ }
+ (*z).PlayerLastConcluding = step(zb0008)
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
if err != nil {
- err = msgp.WrapError(err, "Seed")
+ err = msgp.WrapError(err)
return
}
- case "txn":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "NativeSha512_256Commitment")
- return
- }
- case "txn256":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sha256Commitment")
- return
- }
- case "ts":
- (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "TimeStamp")
- return
- }
- case "gen":
- (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "GenesisID")
- return
- }
- case "gh":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "GenesisHash")
- return
- }
- case "fees":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "FeeSink")
- return
- }
- case "rwd":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *freshnessData) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*freshnessData)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *freshnessData) Msgsize() (s int) {
+ s = 1 + 12 + (*z).PlayerRound.Msgsize() + 13 + msgp.Uint64Size + 11 + msgp.Uint64Size + 21 + msgp.Uint64Size
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *freshnessData) MsgIsZero() bool {
+ return ((*z).PlayerRound.MsgIsZero()) && ((*z).PlayerPeriod == 0) && ((*z).PlayerStep == 0) && ((*z).PlayerLastConcluding == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *message) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 9
+ // string "Bundle"
+ o = append(o, 0x89, 0xa6, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65)
+ o = (*z).Bundle.MarshalMsg(o)
+ // string "CompoundMessage"
+ o = append(o, 0xaf, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65)
+ // map header, size 2
+ // string "Proposal"
+ o = append(o, 0x82, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).CompoundMessage.Proposal.MarshalMsg(o)
+ // string "Vote"
+ o = append(o, 0xa4, 0x56, 0x6f, 0x74, 0x65)
+ o = (*z).CompoundMessage.Vote.MarshalMsg(o)
+ // string "MessageHandle"
+ o = append(o, 0xad, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65)
+ o = (*z).MessageHandle.MarshalMsg(o)
+ // string "Proposal"
+ o = append(o, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).Proposal.MarshalMsg(o)
+ // string "Tag"
+ o = append(o, 0xa3, 0x54, 0x61, 0x67)
+ o = (*z).Tag.MarshalMsg(o)
+ // string "UnauthenticatedBundle"
+ o = append(o, 0xb5, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65)
+ o = (*z).UnauthenticatedBundle.MarshalMsg(o)
+ // string "UnauthenticatedProposal"
+ o = append(o, 0xb7, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).UnauthenticatedProposal.MarshalMsg(o)
+ // string "UnauthenticatedVote"
+ o = append(o, 0xb3, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65)
+ o = (*z).UnauthenticatedVote.MarshalMsg(o)
+ // string "Vote"
+ o = append(o, 0xa4, 0x56, 0x6f, 0x74, 0x65)
+ o = (*z).Vote.MarshalMsg(o)
+ return
+}
+
+func (_ *message) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*message)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *message) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).MessageHandle.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "MessageHandle")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Tag.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Tag")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Vote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Vote")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Bundle.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Bundle")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).UnauthenticatedVote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UnauthenticatedVote")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).UnauthenticatedProposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UnauthenticatedProposal")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).UnauthenticatedBundle.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UnauthenticatedBundle")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "RewardsPool")
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage")
return
}
- case "earn":
- (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsLevel")
- return
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).CompoundMessage.Vote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage", "struct-from-array", "Vote")
+ return
+ }
}
- case "rate":
- (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsRate")
- return
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).CompoundMessage.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage", "struct-from-array", "Proposal")
+ return
+ }
}
- case "frac":
- (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsResidue")
- return
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage", "struct-from-array")
+ return
+ }
}
- case "rwcalr":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ } else {
if err != nil {
- err = msgp.WrapError(err, "RewardsRecalculationRound")
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage")
return
}
- case "proto":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "CurrentProtocol")
- return
+ if zb0004 {
+ (*z).CompoundMessage = compoundMessage{}
}
- case "nextproto":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "NextProtocol")
- return
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage")
+ return
+ }
+ switch string(field) {
+ case "Vote":
+ bts, err = (*z).CompoundMessage.Vote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage", "Vote")
+ return
+ }
+ case "Proposal":
+ bts, err = (*z).CompoundMessage.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage", "Proposal")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CompoundMessage")
+ return
+ }
+ }
}
- case "nextyes":
- (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = message{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "MessageHandle":
+ bts, err = (*z).MessageHandle.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "NextProtocolApprovals")
+ err = msgp.WrapError(err, "MessageHandle")
return
}
- case "nextbefore":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ case "Tag":
+ bts, err = (*z).Tag.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "NextProtocolVoteBefore")
+ err = msgp.WrapError(err, "Tag")
return
}
- case "nextswitch":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ case "Vote":
+ bts, err = (*z).Vote.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "NextProtocolSwitchOn")
+ err = msgp.WrapError(err, "Vote")
return
}
- case "upgradeprop":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ case "Proposal":
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "UpgradePropose")
+ err = msgp.WrapError(err, "Proposal")
return
}
- case "upgradedelay":
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ case "Bundle":
+ bts, err = (*z).Bundle.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "UpgradeDelay")
+ err = msgp.WrapError(err, "Bundle")
return
}
- case "upgradeyes":
- (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ case "UnauthenticatedVote":
+ bts, err = (*z).UnauthenticatedVote.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "UpgradeApprove")
+ err = msgp.WrapError(err, "UnauthenticatedVote")
return
}
- case "tc":
- (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ case "UnauthenticatedProposal":
+ bts, err = (*z).UnauthenticatedProposal.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "TxnCounter")
+ err = msgp.WrapError(err, "UnauthenticatedProposal")
return
}
- case "spt":
- var zb0011 int
- var zb0012 bool
- zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ case "UnauthenticatedBundle":
+ bts, err = (*z).UnauthenticatedBundle.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "StateProofTracking")
- return
- }
- if zb0011 > protocol.NumStateProofTypes {
- err = msgp.ErrOverflow(uint64(zb0011), uint64(protocol.NumStateProofTypes))
- err = msgp.WrapError(err, "StateProofTracking")
+ err = msgp.WrapError(err, "UnauthenticatedBundle")
return
}
- if zb0012 {
- (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = nil
- } else if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
- (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0011)
- }
- for zb0011 > 0 {
- var zb0001 protocol.StateProofType
- var zb0002 bookkeeping.StateProofTrackingData
- zb0011--
- bts, err = zb0001.UnmarshalMsg(bts)
+ case "CompoundMessage":
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "StateProofTracking")
+ err = msgp.WrapError(err, "CompoundMessage")
return
}
- bts, err = zb0002.UnmarshalMsg(bts)
+ if zb0005 > 0 {
+ zb0005--
+ bts, err = (*z).CompoundMessage.Vote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage", "struct-from-array", "Vote")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ zb0005--
+ bts, err = (*z).CompoundMessage.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage", "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0005)
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage", "struct-from-array")
+ return
+ }
+ }
+ } else {
if err != nil {
- err = msgp.WrapError(err, "StateProofTracking", zb0001)
+ err = msgp.WrapError(err, "CompoundMessage")
return
}
- (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking[zb0001] = zb0002
+ if zb0006 {
+ (*z).CompoundMessage = compoundMessage{}
+ }
+ for zb0005 > 0 {
+ zb0005--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage")
+ return
+ }
+ switch string(field) {
+ case "Vote":
+ bts, err = (*z).CompoundMessage.Vote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage", "Vote")
+ return
+ }
+ case "Proposal":
+ bts, err = (*z).CompoundMessage.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage", "Proposal")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "CompoundMessage")
+ return
+ }
+ }
+ }
}
- case "partupdrmv":
- var zb0013 int
- var zb0014 bool
- zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ default:
+ err = msgp.ErrNoField(string(field))
if err != nil {
- err = msgp.WrapError(err, "ExpiredParticipationAccounts")
- return
- }
- if zb0013 > config.MaxProposedExpiredOnlineAccounts {
- err = msgp.ErrOverflow(uint64(zb0013), uint64(config.MaxProposedExpiredOnlineAccounts))
- err = msgp.WrapError(err, "ExpiredParticipationAccounts")
- return
- }
- if zb0014 {
- (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
- } else if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0013 {
- (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0013]
- } else {
- (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0013)
- }
- for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0003)
- return
- }
- }
- case "txns":
- bts, err = (*z).unauthenticatedProposal.Block.Payset.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Payset")
- return
- }
- case "sdpf":
- bts, err = (*z).unauthenticatedProposal.SeedProof.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "SeedProof")
- return
- }
- case "oper":
- {
- var zb0015 uint64
- zb0015, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "OriginalPeriod")
- return
- }
- (*z).unauthenticatedProposal.OriginalPeriod = period(zb0015)
- }
- case "oprop":
- bts, err = (*z).unauthenticatedProposal.OriginalProposer.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "OriginalProposer")
- return
- }
- default:
- err = msgp.ErrNoField(string(field))
- if err != nil {
- err = msgp.WrapError(err)
+ err = msgp.WrapError(err)
return
}
}
@@ -2214,90 +2856,65 @@ func (z *proposal) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *proposal) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*proposal)
+func (_ *message) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*message)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *proposal) Msgsize() (s int) {
- s = 3 + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.Round.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.Branch.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.Seed.Msgsize() + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.Msgsize() + 7 + (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.Msgsize() + 3 + msgp.Int64Size + 4 + msgp.StringPrefixSize + len((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID) + 3 + (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.Msgsize() + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.Msgsize() + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 7 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.Msgsize() + 6 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.Msgsize() + 10 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.Msgsize() + 8 + msgp.Uint64Size + 11 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.Msgsize() + 11 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.Msgsize() + 12 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.Msgsize() + 13 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.Msgsize() + 11 + msgp.BoolSize + 3 + msgp.Uint64Size + 4 + msgp.MapHeaderSize
- if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking != nil {
- for zb0001, zb0002 := range (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking {
- _ = zb0001
- _ = zb0002
- s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
- }
- }
- s += 11 + msgp.ArrayHeaderSize
- for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- s += (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize()
- }
- s += 5 + (*z).unauthenticatedProposal.Block.Payset.Msgsize() + 5 + (*z).unauthenticatedProposal.SeedProof.Msgsize() + 5 + msgp.Uint64Size + 6 + (*z).unauthenticatedProposal.OriginalProposer.Msgsize()
+func (z *message) Msgsize() (s int) {
+ s = 1 + 14 + (*z).MessageHandle.Msgsize() + 4 + (*z).Tag.Msgsize() + 5 + (*z).Vote.Msgsize() + 9 + (*z).Proposal.Msgsize() + 7 + (*z).Bundle.Msgsize() + 20 + (*z).UnauthenticatedVote.Msgsize() + 24 + (*z).UnauthenticatedProposal.Msgsize() + 22 + (*z).UnauthenticatedBundle.Msgsize() + 16 + 1 + 5 + (*z).CompoundMessage.Vote.Msgsize() + 9 + (*z).CompoundMessage.Proposal.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z *proposal) MsgIsZero() bool {
- return ((*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "") && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).unauthenticatedProposal.Block.Payset.MsgIsZero()) && ((*z).unauthenticatedProposal.SeedProof.MsgIsZero()) && ((*z).unauthenticatedProposal.OriginalPeriod == 0) && ((*z).unauthenticatedProposal.OriginalProposer.MsgIsZero())
+func (z *message) MsgIsZero() bool {
+ return ((*z).MessageHandle.MsgIsZero()) && ((*z).Tag.MsgIsZero()) && ((*z).Vote.MsgIsZero()) && ((*z).Proposal.MsgIsZero()) && ((*z).Bundle.MsgIsZero()) && ((*z).UnauthenticatedVote.MsgIsZero()) && ((*z).UnauthenticatedProposal.MsgIsZero()) && ((*z).UnauthenticatedBundle.MsgIsZero()) && (((*z).CompoundMessage.Vote.MsgIsZero()) && ((*z).CompoundMessage.Proposal.MsgIsZero()))
}
// MarshalMsg implements msgp.Marshaler
-func (z *proposalValue) MarshalMsg(b []byte) (o []byte) {
+func (z *messageEvent) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0001Len := uint32(4)
- var zb0001Mask uint8 /* 5 bits */
- if (*z).BlockDigest.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x2
- }
- if (*z).EncodingDigest.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x4
- }
- if (*z).OriginalPeriod == 0 {
- zb0001Len--
- zb0001Mask |= 0x8
- }
- if (*z).OriginalProposer.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x10
- }
- // variable map header, size zb0001Len
- o = append(o, 0x80|uint8(zb0001Len))
- if zb0001Len != 0 {
- if (zb0001Mask & 0x2) == 0 { // if not empty
- // string "dig"
- o = append(o, 0xa3, 0x64, 0x69, 0x67)
- o = (*z).BlockDigest.MarshalMsg(o)
- }
- if (zb0001Mask & 0x4) == 0 { // if not empty
- // string "encdig"
- o = append(o, 0xa6, 0x65, 0x6e, 0x63, 0x64, 0x69, 0x67)
- o = (*z).EncodingDigest.MarshalMsg(o)
- }
- if (zb0001Mask & 0x8) == 0 { // if not empty
- // string "oper"
- o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).OriginalPeriod))
- }
- if (zb0001Mask & 0x10) == 0 { // if not empty
- // string "oprop"
- o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).OriginalProposer.MarshalMsg(o)
- }
+ // map header, size 7
+ // string "Cancelled"
+ o = append(o, 0x87, 0xa9, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64)
+ o = msgp.AppendBool(o, (*z).Cancelled)
+ // string "Err"
+ o = append(o, 0xa3, 0x45, 0x72, 0x72)
+ if (*z).Err == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendString(o, string(*(*z).Err))
+ }
+ // string "Input"
+ o = append(o, 0xa5, 0x49, 0x6e, 0x70, 0x75, 0x74)
+ o = (*z).Input.MarshalMsg(o)
+ // string "Proto"
+ o = append(o, 0xa5, 0x50, 0x72, 0x6f, 0x74, 0x6f)
+ o = (*z).Proto.MarshalMsg(o)
+ // string "T"
+ o = append(o, 0xa1, 0x54)
+ o = msgp.AppendUint8(o, uint8((*z).T))
+ // string "Tail"
+ o = append(o, 0xa4, 0x54, 0x61, 0x69, 0x6c)
+ if (*z).Tail == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = (*z).Tail.MarshalMsg(o)
}
+ // string "TaskIndex"
+ o = append(o, 0xa9, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78)
+ o = msgp.AppendUint64(o, (*z).TaskIndex)
return
}
-func (_ *proposalValue) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*proposalValue)
+func (_ *messageEvent) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*messageEvent)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *proposalValue) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *messageEvent) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -2312,36 +2929,86 @@ func (z *proposalValue) UnmarshalMsg(bts []byte) (o []byte, err error) {
if zb0001 > 0 {
zb0001--
{
- var zb0003 uint64
- zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ var zb0003 uint8
+ zb0003, bts, err = msgp.ReadUint8Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "OriginalPeriod")
+ err = msgp.WrapError(err, "struct-from-array", "T")
return
}
- (*z).OriginalPeriod = period(zb0003)
+ (*z).T = eventType(zb0003)
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ bts, err = (*z).Input.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "OriginalProposer")
+ err = msgp.WrapError(err, "struct-from-array", "Input")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).BlockDigest.UnmarshalMsg(bts)
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ (*z).Err = nil
+ } else {
+ if (*z).Err == nil {
+ (*z).Err = new(serializableError)
+ }
+ {
+ var zb0004 string
+ zb0004, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Err")
+ return
+ }
+ *(*z).Err = serializableError(zb0004)
+ }
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ (*z).TaskIndex, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "BlockDigest")
+ err = msgp.WrapError(err, "struct-from-array", "TaskIndex")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).EncodingDigest.UnmarshalMsg(bts)
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ (*z).Tail = nil
+ } else {
+ if (*z).Tail == nil {
+ (*z).Tail = new(messageEvent)
+ }
+ bts, err = (*z).Tail.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Tail")
+ return
+ }
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ (*z).Cancelled, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "EncodingDigest")
+ err = msgp.WrapError(err, "struct-from-array", "Cancelled")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Proto.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proto")
return
}
}
@@ -2358,7 +3025,7 @@ func (z *proposalValue) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = proposalValue{}
+ (*z) = messageEvent{}
}
for zb0001 > 0 {
zb0001--
@@ -2368,32 +3035,76 @@ func (z *proposalValue) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "oper":
+ case "T":
{
- var zb0004 uint64
- zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ var zb0005 uint8
+ zb0005, bts, err = msgp.ReadUint8Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "OriginalPeriod")
+ err = msgp.WrapError(err, "T")
return
}
- (*z).OriginalPeriod = period(zb0004)
+ (*z).T = eventType(zb0005)
}
- case "oprop":
- bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ case "Input":
+ bts, err = (*z).Input.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "OriginalProposer")
+ err = msgp.WrapError(err, "Input")
return
}
- case "dig":
- bts, err = (*z).BlockDigest.UnmarshalMsg(bts)
+ case "Err":
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ (*z).Err = nil
+ } else {
+ if (*z).Err == nil {
+ (*z).Err = new(serializableError)
+ }
+ {
+ var zb0006 string
+ zb0006, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Err")
+ return
+ }
+ *(*z).Err = serializableError(zb0006)
+ }
+ }
+ case "TaskIndex":
+ (*z).TaskIndex, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "BlockDigest")
+ err = msgp.WrapError(err, "TaskIndex")
return
}
- case "encdig":
- bts, err = (*z).EncodingDigest.UnmarshalMsg(bts)
+ case "Tail":
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ (*z).Tail = nil
+ } else {
+ if (*z).Tail == nil {
+ (*z).Tail = new(messageEvent)
+ }
+ bts, err = (*z).Tail.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Tail")
+ return
+ }
+ }
+ case "Cancelled":
+ (*z).Cancelled, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "EncodingDigest")
+ err = msgp.WrapError(err, "Cancelled")
+ return
+ }
+ case "Proto":
+ bts, err = (*z).Proto.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proto")
return
}
default:
@@ -2409,42 +3120,54 @@ func (z *proposalValue) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *proposalValue) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*proposalValue)
+func (_ *messageEvent) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*messageEvent)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *proposalValue) Msgsize() (s int) {
- s = 1 + 5 + msgp.Uint64Size + 6 + (*z).OriginalProposer.Msgsize() + 4 + (*z).BlockDigest.Msgsize() + 7 + (*z).EncodingDigest.Msgsize()
+func (z *messageEvent) Msgsize() (s int) {
+ s = 1 + 2 + msgp.Uint8Size + 6 + (*z).Input.Msgsize() + 4
+ if (*z).Err == nil {
+ s += msgp.NilSize
+ } else {
+ s += msgp.StringPrefixSize + len(string(*(*z).Err))
+ }
+ s += 10 + msgp.Uint64Size + 5
+ if (*z).Tail == nil {
+ s += msgp.NilSize
+ } else {
+ s += (*z).Tail.Msgsize()
+ }
+ s += 10 + msgp.BoolSize + 6 + (*z).Proto.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z *proposalValue) MsgIsZero() bool {
- return ((*z).OriginalPeriod == 0) && ((*z).OriginalProposer.MsgIsZero()) && ((*z).BlockDigest.MsgIsZero()) && ((*z).EncodingDigest.MsgIsZero())
+func (z *messageEvent) MsgIsZero() bool {
+ return ((*z).T == 0) && ((*z).Input.MsgIsZero()) && ((*z).Err == nil) && ((*z).TaskIndex == 0) && ((*z).Tail == nil) && ((*z).Cancelled == false) && ((*z).Proto.MsgIsZero())
}
// MarshalMsg implements msgp.Marshaler
-func (z *proposerSeed) MarshalMsg(b []byte) (o []byte) {
+func (z *nextThresholdStatusEvent) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
// map header, size 2
- // string "addr"
- o = append(o, 0x82, 0xa4, 0x61, 0x64, 0x64, 0x72)
- o = (*z).Addr.MarshalMsg(o)
- // string "vrf"
- o = append(o, 0xa3, 0x76, 0x72, 0x66)
- o = (*z).VRF.MarshalMsg(o)
+ // string "Bottom"
+ o = append(o, 0x82, 0xa6, 0x42, 0x6f, 0x74, 0x74, 0x6f, 0x6d)
+ o = msgp.AppendBool(o, (*z).Bottom)
+ // string "Proposal"
+ o = append(o, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).Proposal.MarshalMsg(o)
return
}
-func (_ *proposerSeed) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*proposerSeed)
+func (_ *nextThresholdStatusEvent) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*nextThresholdStatusEvent)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *proposerSeed) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *nextThresholdStatusEvent) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -2458,17 +3181,17 @@ func (z *proposerSeed) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Addr.UnmarshalMsg(bts)
+ (*z).Bottom, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Addr")
+ err = msgp.WrapError(err, "struct-from-array", "Bottom")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).VRF.UnmarshalMsg(bts)
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "VRF")
+ err = msgp.WrapError(err, "struct-from-array", "Proposal")
return
}
}
@@ -2485,7 +3208,7 @@ func (z *proposerSeed) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = proposerSeed{}
+ (*z) = nextThresholdStatusEvent{}
}
for zb0001 > 0 {
zb0001--
@@ -2495,16 +3218,16 @@ func (z *proposerSeed) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "addr":
- bts, err = (*z).Addr.UnmarshalMsg(bts)
+ case "Bottom":
+ (*z).Bottom, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Addr")
+ err = msgp.WrapError(err, "Bottom")
return
}
- case "vrf":
- bts, err = (*z).VRF.UnmarshalMsg(bts)
+ case "Proposal":
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "VRF")
+ err = msgp.WrapError(err, "Proposal")
return
}
default:
@@ -2520,148 +3243,192 @@ func (z *proposerSeed) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *proposerSeed) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*proposerSeed)
+func (_ *nextThresholdStatusEvent) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*nextThresholdStatusEvent)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *proposerSeed) Msgsize() (s int) {
- s = 1 + 5 + (*z).Addr.Msgsize() + 4 + (*z).VRF.Msgsize()
+func (z *nextThresholdStatusEvent) Msgsize() (s int) {
+ s = 1 + 7 + msgp.BoolSize + 9 + (*z).Proposal.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z *proposerSeed) MsgIsZero() bool {
- return ((*z).Addr.MsgIsZero()) && ((*z).VRF.MsgIsZero())
+func (z *nextThresholdStatusEvent) MsgIsZero() bool {
+ return ((*z).Bottom == false) && ((*z).Proposal.MsgIsZero())
}
// MarshalMsg implements msgp.Marshaler
-func (z *rawVote) MarshalMsg(b []byte) (o []byte) {
+func (z period) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0001Len := uint32(5)
- var zb0001Mask uint8 /* 6 bits */
- if (*z).Period == 0 {
- zb0001Len--
- zb0001Mask |= 0x2
- }
- if (*z).Proposal.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x4
+ o = msgp.AppendUint64(o, uint64(z))
+ return
+}
+
+func (_ period) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(period)
+ if !ok {
+ _, ok = (z).(*period)
}
- if (*z).Round.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x8
- }
- if (*z).Sender.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x10
- }
- if (*z).Step == 0 {
- zb0001Len--
- zb0001Mask |= 0x20
- }
- // variable map header, size zb0001Len
- o = append(o, 0x80|uint8(zb0001Len))
- if zb0001Len != 0 {
- if (zb0001Mask & 0x2) == 0 { // if not empty
- // string "per"
- o = append(o, 0xa3, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).Period))
- }
- if (zb0001Mask & 0x4) == 0 { // if not empty
- // string "prop"
- o = append(o, 0xa4, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).Proposal.MarshalMsg(o)
- }
- if (zb0001Mask & 0x8) == 0 { // if not empty
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).Round.MarshalMsg(o)
- }
- if (zb0001Mask & 0x10) == 0 { // if not empty
- // string "snd"
- o = append(o, 0xa3, 0x73, 0x6e, 0x64)
- o = (*z).Sender.MarshalMsg(o)
- }
- if (zb0001Mask & 0x20) == 0 { // if not empty
- // string "step"
- o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
- o = msgp.AppendUint64(o, uint64((*z).Step))
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *period) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ {
+ var zb0001 uint64
+ zb0001, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
+ (*z) = period(zb0001)
}
+ o = bts
return
}
-func (_ *rawVote) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*rawVote)
+func (_ *period) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*period)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z period) Msgsize() (s int) {
+ s = msgp.Uint64Size
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z period) MsgIsZero() bool {
+ return z == 0
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *periodRouter) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 4
+ // string "Children"
+ o = append(o, 0x84, 0xa8, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e)
+ if (*z).Children == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Children)))
+ }
+ zb0001_keys := make([]step, 0, len((*z).Children))
+ for zb0001 := range (*z).Children {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortStep(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Children[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ if zb0002 == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = zb0002.MarshalMsg(o)
+ }
+ }
+ // string "ProposalTracker"
+ o = append(o, 0xaf, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72)
+ o = (*z).ProposalTracker.MarshalMsg(o)
+ // string "ProposalTrackerContract"
+ o = append(o, 0xb7, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74)
+ o = (*z).ProposalTrackerContract.MarshalMsg(o)
+ // string "VoteTrackerPeriod"
+ o = append(o, 0xb1, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64)
+ o = (*z).VoteTrackerPeriod.MarshalMsg(o)
+ return
+}
+
+func (_ *periodRouter) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*periodRouter)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *rawVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *periodRouter) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
- var zb0001 int
- var zb0002 bool
- zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
if _, ok := err.(msgp.TypeError); ok {
- zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
- if zb0001 > 0 {
- zb0001--
- bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).ProposalTracker.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sender")
+ err = msgp.WrapError(err, "struct-from-array", "ProposalTracker")
return
}
}
- if zb0001 > 0 {
- zb0001--
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).VoteTrackerPeriod.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerPeriod")
return
}
}
- if zb0001 > 0 {
- zb0001--
- {
- var zb0003 uint64
- zb0003, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Period")
- return
- }
- (*z).Period = period(zb0003)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).ProposalTrackerContract.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalTrackerContract")
+ return
}
}
- if zb0001 > 0 {
- zb0001--
- {
- var zb0004 uint64
- zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children")
+ return
+ }
+ if zb0006 {
+ (*z).Children = nil
+ } else if (*z).Children == nil {
+ (*z).Children = make(map[step]*stepRouter, zb0005)
+ }
+ for zb0005 > 0 {
+ var zb0001 step
+ var zb0002 *stepRouter
+ zb0005--
+ bts, err = zb0001.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Step")
+ err = msgp.WrapError(err, "struct-from-array", "Children")
return
}
- (*z).Step = step(zb0004)
- }
- }
- if zb0001 > 0 {
- zb0001--
- bts, err = (*z).Proposal.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposal")
- return
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(stepRouter)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children", zb0001)
+ return
+ }
+ }
+ (*z).Children[zb0001] = zb0002
}
}
- if zb0001 > 0 {
- err = msgp.ErrTooManyArrayFields(zb0001)
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
if err != nil {
err = msgp.WrapError(err, "struct-from-array")
return
@@ -2672,54 +3439,74 @@ func (z *rawVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
- if zb0002 {
- (*z) = rawVote{}
+ if zb0004 {
+ (*z) = periodRouter{}
}
- for zb0001 > 0 {
- zb0001--
+ for zb0003 > 0 {
+ zb0003--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch string(field) {
- case "snd":
- bts, err = (*z).Sender.UnmarshalMsg(bts)
+ case "ProposalTracker":
+ bts, err = (*z).ProposalTracker.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Sender")
+ err = msgp.WrapError(err, "ProposalTracker")
return
}
- case "rnd":
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ case "VoteTrackerPeriod":
+ bts, err = (*z).VoteTrackerPeriod.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Round")
+ err = msgp.WrapError(err, "VoteTrackerPeriod")
return
}
- case "per":
- {
- var zb0005 uint64
- zb0005, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "Period")
- return
- }
- (*z).Period = period(zb0005)
+ case "ProposalTrackerContract":
+ bts, err = (*z).ProposalTrackerContract.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalTrackerContract")
+ return
}
- case "step":
- {
- var zb0006 uint64
- zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ case "Children":
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children")
+ return
+ }
+ if zb0008 {
+ (*z).Children = nil
+ } else if (*z).Children == nil {
+ (*z).Children = make(map[step]*stepRouter, zb0007)
+ }
+ for zb0007 > 0 {
+ var zb0001 step
+ var zb0002 *stepRouter
+ zb0007--
+ bts, err = zb0001.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Step")
+ err = msgp.WrapError(err, "Children")
return
}
- (*z).Step = step(zb0006)
- }
- case "prop":
- bts, err = (*z).Proposal.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Proposal")
- return
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(stepRouter)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children", zb0001)
+ return
+ }
+ }
+ (*z).Children[zb0001] = zb0002
}
default:
err = msgp.ErrNoField(string(field))
@@ -2734,42 +3521,72 @@ func (z *rawVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *rawVote) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*rawVote)
+func (_ *periodRouter) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*periodRouter)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *rawVote) Msgsize() (s int) {
- s = 1 + 4 + (*z).Sender.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Proposal.Msgsize()
+func (z *periodRouter) Msgsize() (s int) {
+ s = 1 + 16 + (*z).ProposalTracker.Msgsize() + 18 + (*z).VoteTrackerPeriod.Msgsize() + 24 + (*z).ProposalTrackerContract.Msgsize() + 9 + msgp.MapHeaderSize
+ if (*z).Children != nil {
+ for zb0001, zb0002 := range (*z).Children {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize()
+ if zb0002 == nil {
+ s += msgp.NilSize
+ } else {
+ s += zb0002.Msgsize()
+ }
+ }
+ }
return
}
// MsgIsZero returns whether this is a zero value
-func (z *rawVote) MsgIsZero() bool {
- return ((*z).Sender.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Proposal.MsgIsZero())
+func (z *periodRouter) MsgIsZero() bool {
+ return ((*z).ProposalTracker.MsgIsZero()) && ((*z).VoteTrackerPeriod.MsgIsZero()) && ((*z).ProposalTrackerContract.MsgIsZero()) && (len((*z).Children) == 0)
}
// MarshalMsg implements msgp.Marshaler
-func (z *seedInput) MarshalMsg(b []byte) (o []byte) {
+func (z *player) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // map header, size 2
- // string "alpha"
- o = append(o, 0x82, 0xa5, 0x61, 0x6c, 0x70, 0x68, 0x61)
- o = (*z).Alpha.MarshalMsg(o)
- // string "hist"
- o = append(o, 0xa4, 0x68, 0x69, 0x73, 0x74)
- o = (*z).History.MarshalMsg(o)
+ // map header, size 8
+ // string "Deadline"
+ o = append(o, 0x88, 0xa8, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65)
+ o = msgp.AppendDuration(o, (*z).Deadline)
+ // string "FastRecoveryDeadline"
+ o = append(o, 0xb4, 0x46, 0x61, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65)
+ o = msgp.AppendDuration(o, (*z).FastRecoveryDeadline)
+ // string "LastConcluding"
+ o = append(o, 0xae, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67)
+ o = msgp.AppendUint64(o, uint64((*z).LastConcluding))
+ // string "Napping"
+ o = append(o, 0xa7, 0x4e, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67)
+ o = msgp.AppendBool(o, (*z).Napping)
+ // string "Pending"
+ o = append(o, 0xa7, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67)
+ o = (*z).Pending.MarshalMsg(o)
+ // string "Period"
+ o = append(o, 0xa6, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
+ // string "Round"
+ o = append(o, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
+ // string "Step"
+ o = append(o, 0xa4, 0x53, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
return
}
-func (_ *seedInput) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*seedInput)
+func (_ *player) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*player)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *seedInput) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *player) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -2783,159 +3600,78 @@ func (z *seedInput) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Alpha.UnmarshalMsg(bts)
+ bts, err = (*z).Round.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Alpha")
+ err = msgp.WrapError(err, "struct-from-array", "Round")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).History.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "History")
- return
+ {
+ var zb0003 uint64
+ zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0003)
}
}
if zb0001 > 0 {
- err = msgp.ErrTooManyArrayFields(zb0001)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array")
- return
+ zb0001--
+ {
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0004)
}
}
- } else {
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
- if zb0002 {
- (*z) = seedInput{}
- }
- for zb0001 > 0 {
+ if zb0001 > 0 {
zb0001--
- field, bts, err = msgp.ReadMapKeyZC(bts)
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
- switch string(field) {
- case "alpha":
- bts, err = (*z).Alpha.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Alpha")
- return
- }
- case "hist":
- bts, err = (*z).History.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "History")
- return
- }
- default:
- err = msgp.ErrNoField(string(field))
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err)
+ err = msgp.WrapError(err, "struct-from-array", "LastConcluding")
return
}
+ (*z).LastConcluding = step(zb0005)
}
}
- }
- o = bts
- return
-}
-
-func (_ *seedInput) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*seedInput)
- return ok
-}
-
-// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *seedInput) Msgsize() (s int) {
- s = 1 + 6 + (*z).Alpha.Msgsize() + 5 + (*z).History.Msgsize()
- return
-}
-
-// MsgIsZero returns whether this is a zero value
-func (z *seedInput) MsgIsZero() bool {
- return ((*z).Alpha.MsgIsZero()) && ((*z).History.MsgIsZero())
-}
-
-// MarshalMsg implements msgp.Marshaler
-func (z *selector) MarshalMsg(b []byte) (o []byte) {
- o = msgp.Require(b, z.Msgsize())
- // map header, size 4
- // string "per"
- o = append(o, 0x84, 0xa3, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).Period))
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).Round.MarshalMsg(o)
- // string "seed"
- o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
- o = (*z).Seed.MarshalMsg(o)
- // string "step"
- o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
- o = msgp.AppendUint64(o, uint64((*z).Step))
- return
-}
-
-func (_ *selector) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*selector)
- return ok
-}
-
-// UnmarshalMsg implements msgp.Unmarshaler
-func (z *selector) UnmarshalMsg(bts []byte) (o []byte, err error) {
- var field []byte
- _ = field
- var zb0001 int
- var zb0002 bool
- zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
- if _, ok := err.(msgp.TypeError); ok {
- zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Seed.UnmarshalMsg(bts)
+ (*z).Deadline, bts, err = msgp.ReadDurationBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Seed")
+ err = msgp.WrapError(err, "struct-from-array", "Deadline")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ (*z).Napping, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
+ err = msgp.WrapError(err, "struct-from-array", "Napping")
return
}
}
if zb0001 > 0 {
zb0001--
- {
- var zb0003 uint64
- zb0003, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Period")
- return
- }
- (*z).Period = period(zb0003)
+ (*z).FastRecoveryDeadline, bts, err = msgp.ReadDurationBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "FastRecoveryDeadline")
+ return
}
}
if zb0001 > 0 {
zb0001--
- {
- var zb0004 uint64
- zb0004, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Step")
- return
- }
- (*z).Step = step(zb0004)
+ bts, err = (*z).Pending.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Pending")
+ return
}
}
if zb0001 > 0 {
@@ -2951,7 +3687,7 @@ func (z *selector) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = selector{}
+ (*z) = player{}
}
for zb0001 > 0 {
zb0001--
@@ -2961,37 +3697,65 @@ func (z *selector) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "seed":
- bts, err = (*z).Seed.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Seed")
- return
- }
- case "rnd":
+ case "Round":
bts, err = (*z).Round.UnmarshalMsg(bts)
if err != nil {
err = msgp.WrapError(err, "Round")
return
}
- case "per":
+ case "Period":
{
- var zb0005 uint64
- zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
err = msgp.WrapError(err, "Period")
return
}
- (*z).Period = period(zb0005)
+ (*z).Period = period(zb0006)
}
- case "step":
+ case "Step":
{
- var zb0006 uint64
- zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ var zb0007 uint64
+ zb0007, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
err = msgp.WrapError(err, "Step")
return
}
- (*z).Step = step(zb0006)
+ (*z).Step = step(zb0007)
+ }
+ case "LastConcluding":
+ {
+ var zb0008 uint64
+ zb0008, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "LastConcluding")
+ return
+ }
+ (*z).LastConcluding = step(zb0008)
+ }
+ case "Deadline":
+ (*z).Deadline, bts, err = msgp.ReadDurationBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Deadline")
+ return
+ }
+ case "Napping":
+ (*z).Napping, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Napping")
+ return
+ }
+ case "FastRecoveryDeadline":
+ (*z).FastRecoveryDeadline, bts, err = msgp.ReadDurationBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "FastRecoveryDeadline")
+ return
+ }
+ case "Pending":
+ bts, err = (*z).Pending.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Pending")
+ return
}
default:
err = msgp.ErrNoField(string(field))
@@ -3006,299 +3770,203 @@ func (z *selector) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *selector) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*selector)
- return ok
-}
-
-// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *selector) Msgsize() (s int) {
- s = 1 + 5 + (*z).Seed.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size
- return
-}
-
-// MsgIsZero returns whether this is a zero value
-func (z *selector) MsgIsZero() bool {
- return ((*z).Seed.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0)
-}
-
-// MarshalMsg implements msgp.Marshaler
-func (z serializableErrorUnderlying) MarshalMsg(b []byte) (o []byte) {
- o = msgp.Require(b, z.Msgsize())
- o = msgp.AppendString(o, string(z))
- return
-}
-
-func (_ serializableErrorUnderlying) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(serializableErrorUnderlying)
- if !ok {
- _, ok = (z).(*serializableErrorUnderlying)
- }
- return ok
-}
-
-// UnmarshalMsg implements msgp.Unmarshaler
-func (z *serializableErrorUnderlying) UnmarshalMsg(bts []byte) (o []byte, err error) {
- {
- var zb0001 string
- zb0001, bts, err = msgp.ReadStringBytes(bts)
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
- (*z) = serializableErrorUnderlying(zb0001)
- }
- o = bts
- return
-}
-
-func (_ *serializableErrorUnderlying) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*serializableErrorUnderlying)
- return ok
-}
-
-// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z serializableErrorUnderlying) Msgsize() (s int) {
- s = msgp.StringPrefixSize + len(string(z))
- return
-}
-
-// MsgIsZero returns whether this is a zero value
-func (z serializableErrorUnderlying) MsgIsZero() bool {
- return z == ""
-}
-
-// MarshalMsg implements msgp.Marshaler
-func (z step) MarshalMsg(b []byte) (o []byte) {
- o = msgp.Require(b, z.Msgsize())
- o = msgp.AppendUint64(o, uint64(z))
- return
-}
-
-func (_ step) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(step)
- if !ok {
- _, ok = (z).(*step)
- }
- return ok
-}
-
-// UnmarshalMsg implements msgp.Unmarshaler
-func (z *step) UnmarshalMsg(bts []byte) (o []byte, err error) {
- {
- var zb0001 uint64
- zb0001, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err)
- return
- }
- (*z) = step(zb0001)
- }
- o = bts
- return
-}
-
-func (_ *step) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*step)
+func (_ *player) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*player)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z step) Msgsize() (s int) {
- s = msgp.Uint64Size
+func (z *player) Msgsize() (s int) {
+ s = 1 + 6 + (*z).Round.Msgsize() + 7 + msgp.Uint64Size + 5 + msgp.Uint64Size + 15 + msgp.Uint64Size + 9 + msgp.DurationSize + 8 + msgp.BoolSize + 21 + msgp.DurationSize + 8 + (*z).Pending.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z step) MsgIsZero() bool {
- return z == 0
+func (z *player) MsgIsZero() bool {
+ return ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).LastConcluding == 0) && ((*z).Deadline == 0) && ((*z).Napping == false) && ((*z).FastRecoveryDeadline == 0) && ((*z).Pending.MsgIsZero())
}
// MarshalMsg implements msgp.Marshaler
-func (z *transmittedPayload) MarshalMsg(b []byte) (o []byte) {
+func (z *proposal) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
// omitempty: check for empty values
- zb0004Len := uint32(30)
- var zb0004Mask uint64 /* 37 bits */
+ zb0004Len := uint32(29)
+ var zb0004Mask uint64 /* 38 bits */
if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0 {
zb0004Len--
- zb0004Mask |= 0x80
+ zb0004Mask |= 0x40
}
if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x100
+ zb0004Mask |= 0x80
}
if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0 {
zb0004Len--
- zb0004Mask |= 0x200
+ zb0004Mask |= 0x100
}
if (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "" {
zb0004Len--
- zb0004Mask |= 0x400
+ zb0004Mask |= 0x200
}
if (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x800
+ zb0004Mask |= 0x400
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x1000
+ zb0004Mask |= 0x800
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x2000
+ zb0004Mask |= 0x1000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x4000
+ zb0004Mask |= 0x2000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0 {
zb0004Len--
- zb0004Mask |= 0x8000
+ zb0004Mask |= 0x4000
}
if (*z).unauthenticatedProposal.OriginalPeriod == 0 {
zb0004Len--
- zb0004Mask |= 0x10000
+ zb0004Mask |= 0x8000
}
if (*z).unauthenticatedProposal.OriginalProposer.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x20000
+ zb0004Mask |= 0x10000
}
if len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0 {
zb0004Len--
- zb0004Mask |= 0x40000
+ zb0004Mask |= 0x20000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x80000
+ zb0004Mask |= 0x40000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x100000
- }
- if (*z).PriorVote.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x200000
+ zb0004Mask |= 0x80000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0 {
zb0004Len--
- zb0004Mask |= 0x400000
+ zb0004Mask |= 0x100000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x800000
+ zb0004Mask |= 0x400000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x1000000
+ zb0004Mask |= 0x800000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x2000000
+ zb0004Mask |= 0x1000000
}
if (*z).unauthenticatedProposal.SeedProof.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x4000000
+ zb0004Mask |= 0x2000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x8000000
+ zb0004Mask |= 0x4000000
}
if len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0 {
zb0004Len--
- zb0004Mask |= 0x10000000
+ zb0004Mask |= 0x8000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0 {
zb0004Len--
- zb0004Mask |= 0x20000000
+ zb0004Mask |= 0x10000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0 {
zb0004Len--
- zb0004Mask |= 0x40000000
+ zb0004Mask |= 0x20000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x80000000
+ zb0004Mask |= 0x40000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x100000000
+ zb0004Mask |= 0x80000000
}
if (*z).unauthenticatedProposal.Block.Payset.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x200000000
+ zb0004Mask |= 0x100000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x400000000
+ zb0004Mask |= 0x200000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero() {
zb0004Len--
- zb0004Mask |= 0x800000000
+ zb0004Mask |= 0x400000000
}
if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false {
zb0004Len--
- zb0004Mask |= 0x1000000000
+ zb0004Mask |= 0x800000000
}
// variable map header, size zb0004Len
o = msgp.AppendMapHeader(o, zb0004Len)
if zb0004Len != 0 {
- if (zb0004Mask & 0x80) == 0 { // if not empty
+ if (zb0004Mask & 0x40) == 0 { // if not empty
// string "earn"
o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e)
o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel)
}
- if (zb0004Mask & 0x100) == 0 { // if not empty
+ if (zb0004Mask & 0x80) == 0 { // if not empty
// string "fees"
o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73)
o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MarshalMsg(o)
}
- if (zb0004Mask & 0x200) == 0 { // if not empty
+ if (zb0004Mask & 0x100) == 0 { // if not empty
// string "frac"
o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63)
o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue)
}
- if (zb0004Mask & 0x400) == 0 { // if not empty
+ if (zb0004Mask & 0x200) == 0 { // if not empty
// string "gen"
o = append(o, 0xa3, 0x67, 0x65, 0x6e)
o = msgp.AppendString(o, (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID)
}
- if (zb0004Mask & 0x800) == 0 { // if not empty
+ if (zb0004Mask & 0x400) == 0 { // if not empty
// string "gh"
o = append(o, 0xa2, 0x67, 0x68)
o = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MarshalMsg(o)
}
- if (zb0004Mask & 0x1000) == 0 { // if not empty
+ if (zb0004Mask & 0x800) == 0 { // if not empty
// string "nextbefore"
o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65)
o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MarshalMsg(o)
}
- if (zb0004Mask & 0x2000) == 0 { // if not empty
+ if (zb0004Mask & 0x1000) == 0 { // if not empty
// string "nextproto"
o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f)
o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MarshalMsg(o)
}
- if (zb0004Mask & 0x4000) == 0 { // if not empty
+ if (zb0004Mask & 0x2000) == 0 { // if not empty
// string "nextswitch"
o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68)
o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MarshalMsg(o)
}
- if (zb0004Mask & 0x8000) == 0 { // if not empty
+ if (zb0004Mask & 0x4000) == 0 { // if not empty
// string "nextyes"
o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73)
o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals)
}
- if (zb0004Mask & 0x10000) == 0 { // if not empty
+ if (zb0004Mask & 0x8000) == 0 { // if not empty
// string "oper"
o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
o = msgp.AppendUint64(o, uint64((*z).unauthenticatedProposal.OriginalPeriod))
}
- if (zb0004Mask & 0x20000) == 0 { // if not empty
+ if (zb0004Mask & 0x10000) == 0 { // if not empty
// string "oprop"
o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
o = (*z).unauthenticatedProposal.OriginalProposer.MarshalMsg(o)
}
- if (zb0004Mask & 0x40000) == 0 { // if not empty
+ if (zb0004Mask & 0x20000) == 0 { // if not empty
// string "partupdrmv"
o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76)
if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts == nil {
@@ -3310,52 +3978,47 @@ func (z *transmittedPayload) MarshalMsg(b []byte) (o []byte) {
o = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o)
}
}
- if (zb0004Mask & 0x80000) == 0 { // if not empty
+ if (zb0004Mask & 0x40000) == 0 { // if not empty
// string "prev"
o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76)
o = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.MarshalMsg(o)
}
- if (zb0004Mask & 0x100000) == 0 { // if not empty
+ if (zb0004Mask & 0x80000) == 0 { // if not empty
// string "proto"
o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f)
o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MarshalMsg(o)
}
- if (zb0004Mask & 0x200000) == 0 { // if not empty
- // string "pv"
- o = append(o, 0xa2, 0x70, 0x76)
- o = (*z).PriorVote.MarshalMsg(o)
- }
- if (zb0004Mask & 0x400000) == 0 { // if not empty
+ if (zb0004Mask & 0x100000) == 0 { // if not empty
// string "rate"
o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65)
o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate)
}
- if (zb0004Mask & 0x800000) == 0 { // if not empty
+ if (zb0004Mask & 0x400000) == 0 { // if not empty
// string "rnd"
o = append(o, 0xa3, 0x72, 0x6e, 0x64)
o = (*z).unauthenticatedProposal.Block.BlockHeader.Round.MarshalMsg(o)
}
- if (zb0004Mask & 0x1000000) == 0 { // if not empty
+ if (zb0004Mask & 0x800000) == 0 { // if not empty
// string "rwcalr"
o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72)
o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MarshalMsg(o)
}
- if (zb0004Mask & 0x2000000) == 0 { // if not empty
+ if (zb0004Mask & 0x1000000) == 0 { // if not empty
// string "rwd"
o = append(o, 0xa3, 0x72, 0x77, 0x64)
o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MarshalMsg(o)
}
- if (zb0004Mask & 0x4000000) == 0 { // if not empty
+ if (zb0004Mask & 0x2000000) == 0 { // if not empty
// string "sdpf"
o = append(o, 0xa4, 0x73, 0x64, 0x70, 0x66)
o = (*z).unauthenticatedProposal.SeedProof.MarshalMsg(o)
}
- if (zb0004Mask & 0x8000000) == 0 { // if not empty
+ if (zb0004Mask & 0x4000000) == 0 { // if not empty
// string "seed"
o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
o = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.MarshalMsg(o)
}
- if (zb0004Mask & 0x10000000) == 0 { // if not empty
+ if (zb0004Mask & 0x8000000) == 0 { // if not empty
// string "spt"
o = append(o, 0xa3, 0x73, 0x70, 0x74)
if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
@@ -3375,42 +4038,42 @@ func (z *transmittedPayload) MarshalMsg(b []byte) (o []byte) {
o = zb0002.MarshalMsg(o)
}
}
- if (zb0004Mask & 0x20000000) == 0 { // if not empty
+ if (zb0004Mask & 0x10000000) == 0 { // if not empty
// string "tc"
o = append(o, 0xa2, 0x74, 0x63)
o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter)
}
- if (zb0004Mask & 0x40000000) == 0 { // if not empty
+ if (zb0004Mask & 0x20000000) == 0 { // if not empty
// string "ts"
o = append(o, 0xa2, 0x74, 0x73)
o = msgp.AppendInt64(o, (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp)
}
- if (zb0004Mask & 0x80000000) == 0 { // if not empty
+ if (zb0004Mask & 0x40000000) == 0 { // if not empty
// string "txn"
o = append(o, 0xa3, 0x74, 0x78, 0x6e)
o = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MarshalMsg(o)
}
- if (zb0004Mask & 0x100000000) == 0 { // if not empty
+ if (zb0004Mask & 0x80000000) == 0 { // if not empty
// string "txn256"
o = append(o, 0xa6, 0x74, 0x78, 0x6e, 0x32, 0x35, 0x36)
o = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MarshalMsg(o)
}
- if (zb0004Mask & 0x200000000) == 0 { // if not empty
+ if (zb0004Mask & 0x100000000) == 0 { // if not empty
// string "txns"
o = append(o, 0xa4, 0x74, 0x78, 0x6e, 0x73)
o = (*z).unauthenticatedProposal.Block.Payset.MarshalMsg(o)
}
- if (zb0004Mask & 0x400000000) == 0 { // if not empty
+ if (zb0004Mask & 0x200000000) == 0 { // if not empty
// string "upgradedelay"
o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79)
o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MarshalMsg(o)
}
- if (zb0004Mask & 0x800000000) == 0 { // if not empty
+ if (zb0004Mask & 0x400000000) == 0 { // if not empty
// string "upgradeprop"
o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70)
o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MarshalMsg(o)
}
- if (zb0004Mask & 0x1000000000) == 0 { // if not empty
+ if (zb0004Mask & 0x800000000) == 0 { // if not empty
// string "upgradeyes"
o = append(o, 0xaa, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x79, 0x65, 0x73)
o = msgp.AppendBool(o, (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove)
@@ -3419,13 +4082,13 @@ func (z *transmittedPayload) MarshalMsg(b []byte) (o []byte) {
return
}
-func (_ *transmittedPayload) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*transmittedPayload)
+func (_ *proposal) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposal)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *transmittedPayload) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *proposal) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0004 int
@@ -3722,14 +4385,6 @@ func (z *transmittedPayload) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).PriorVote.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "PriorVote")
- return
- }
- }
if zb0004 > 0 {
err = msgp.ErrTooManyArrayFields(zb0004)
if err != nil {
@@ -3743,7 +4398,7 @@ func (z *transmittedPayload) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0005 {
- (*z) = transmittedPayload{}
+ (*z) = proposal{}
}
for zb0004 > 0 {
zb0004--
@@ -3980,12 +4635,6 @@ func (z *transmittedPayload) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "OriginalProposer")
return
}
- case "pv":
- bts, err = (*z).PriorVote.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "PriorVote")
- return
- }
default:
err = msgp.ErrNoField(string(field))
if err != nil {
@@ -3999,13 +4648,13 @@ func (z *transmittedPayload) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *transmittedPayload) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*transmittedPayload)
+func (_ *proposal) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposal)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *transmittedPayload) Msgsize() (s int) {
+func (z *proposal) Msgsize() (s int) {
s = 3 + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.Round.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.Branch.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.Seed.Msgsize() + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.Msgsize() + 7 + (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.Msgsize() + 3 + msgp.Int64Size + 4 + msgp.StringPrefixSize + len((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID) + 3 + (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.Msgsize() + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.Msgsize() + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 7 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.Msgsize() + 6 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.Msgsize() + 10 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.Msgsize() + 8 + msgp.Uint64Size + 11 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.Msgsize() + 11 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.Msgsize() + 12 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.Msgsize() + 13 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.Msgsize() + 11 + msgp.BoolSize + 3 + msgp.Uint64Size + 4 + msgp.MapHeaderSize
if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking != nil {
for zb0001, zb0002 := range (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking {
@@ -4018,214 +4667,357 @@ func (z *transmittedPayload) Msgsize() (s int) {
for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
s += (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize()
}
- s += 5 + (*z).unauthenticatedProposal.Block.Payset.Msgsize() + 5 + (*z).unauthenticatedProposal.SeedProof.Msgsize() + 5 + msgp.Uint64Size + 6 + (*z).unauthenticatedProposal.OriginalProposer.Msgsize() + 3 + (*z).PriorVote.Msgsize()
+ s += 5 + (*z).unauthenticatedProposal.Block.Payset.Msgsize() + 5 + (*z).unauthenticatedProposal.SeedProof.Msgsize() + 5 + msgp.Uint64Size + 6 + (*z).unauthenticatedProposal.OriginalProposer.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z *transmittedPayload) MsgIsZero() bool {
- return ((*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "") && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).unauthenticatedProposal.Block.Payset.MsgIsZero()) && ((*z).unauthenticatedProposal.SeedProof.MsgIsZero()) && ((*z).unauthenticatedProposal.OriginalPeriod == 0) && ((*z).unauthenticatedProposal.OriginalProposer.MsgIsZero()) && ((*z).PriorVote.MsgIsZero())
+func (z *proposal) MsgIsZero() bool {
+ return ((*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "") && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).unauthenticatedProposal.Block.Payset.MsgIsZero()) && ((*z).unauthenticatedProposal.SeedProof.MsgIsZero()) && ((*z).unauthenticatedProposal.OriginalPeriod == 0) && ((*z).unauthenticatedProposal.OriginalProposer.MsgIsZero())
}
// MarshalMsg implements msgp.Marshaler
-func (z *unauthenticatedBundle) MarshalMsg(b []byte) (o []byte) {
+func (z *proposalManager) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0003Len := uint32(6)
- var zb0003Mask uint8 /* 7 bits */
- if len((*z).EquivocationVotes) == 0 {
- zb0003Len--
- zb0003Mask |= 0x2
- }
- if (*z).Period == 0 {
- zb0003Len--
- zb0003Mask |= 0x4
- }
- if (*z).Proposal.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x8
- }
- if (*z).Round.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x10
- }
- if (*z).Step == 0 {
- zb0003Len--
- zb0003Mask |= 0x20
- }
- if len((*z).Votes) == 0 {
- zb0003Len--
- zb0003Mask |= 0x40
- }
- // variable map header, size zb0003Len
- o = append(o, 0x80|uint8(zb0003Len))
- if zb0003Len != 0 {
- if (zb0003Mask & 0x2) == 0 { // if not empty
- // string "eqv"
- o = append(o, 0xa3, 0x65, 0x71, 0x76)
- if (*z).EquivocationVotes == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendArrayHeader(o, uint32(len((*z).EquivocationVotes)))
- }
- for zb0002 := range (*z).EquivocationVotes {
- o = (*z).EquivocationVotes[zb0002].MarshalMsg(o)
- }
- }
- if (zb0003Mask & 0x4) == 0 { // if not empty
- // string "per"
- o = append(o, 0xa3, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).Period))
- }
- if (zb0003Mask & 0x8) == 0 { // if not empty
- // string "prop"
- o = append(o, 0xa4, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).Proposal.MarshalMsg(o)
- }
- if (zb0003Mask & 0x10) == 0 { // if not empty
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).Round.MarshalMsg(o)
- }
- if (zb0003Mask & 0x20) == 0 { // if not empty
- // string "step"
- o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
- o = msgp.AppendUint64(o, uint64((*z).Step))
- }
- if (zb0003Mask & 0x40) == 0 { // if not empty
- // string "vote"
- o = append(o, 0xa4, 0x76, 0x6f, 0x74, 0x65)
- if (*z).Votes == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendArrayHeader(o, uint32(len((*z).Votes)))
- }
- for zb0001 := range (*z).Votes {
- o = (*z).Votes[zb0001].MarshalMsg(o)
- }
- }
- }
+ // map header, size 0
+ o = append(o, 0x80)
return
}
-func (_ *unauthenticatedBundle) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedBundle)
+func (_ *proposalManager) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalManager)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *unauthenticatedBundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *proposalManager) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
- var zb0003 int
- var zb0004 bool
- zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
if _, ok := err.(msgp.TypeError); ok {
- zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
}
- if zb0003 > 0 {
- zb0003--
- {
- var zb0005 uint64
- zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = proposalManager{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ default:
+ err = msgp.ErrNoField(string(field))
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Period")
+ err = msgp.WrapError(err)
return
}
- (*z).Period = period(zb0005)
}
}
- if zb0003 > 0 {
- zb0003--
- {
- var zb0006 uint64
- zb0006, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Step")
- return
- }
- (*z).Step = step(zb0006)
+ }
+ o = bts
+ return
+}
+
+func (_ *proposalManager) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalManager)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposalManager) Msgsize() (s int) {
+ s = 1
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposalManager) MsgIsZero() bool {
+ return true
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *proposalSeeker) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 3
+ // string "Filled"
+ o = append(o, 0x83, 0xa6, 0x46, 0x69, 0x6c, 0x6c, 0x65, 0x64)
+ o = msgp.AppendBool(o, (*z).Filled)
+ // string "Frozen"
+ o = append(o, 0xa6, 0x46, 0x72, 0x6f, 0x7a, 0x65, 0x6e)
+ o = msgp.AppendBool(o, (*z).Frozen)
+ // string "Lowest"
+ o = append(o, 0xa6, 0x4c, 0x6f, 0x77, 0x65, 0x73, 0x74)
+ o = (*z).Lowest.MarshalMsg(o)
+ return
+}
+
+func (_ *proposalSeeker) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalSeeker)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposalSeeker) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Lowest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Lowest")
+ return
}
}
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ (*z).Filled, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposal")
+ err = msgp.WrapError(err, "struct-from-array", "Filled")
return
}
}
- if zb0003 > 0 {
- zb0003--
- var zb0007 int
- var zb0008 bool
- zb0007, zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if zb0001 > 0 {
+ zb0001--
+ (*z).Frozen, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Votes")
+ err = msgp.WrapError(err, "struct-from-array", "Frozen")
return
}
- if zb0007 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0007), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "struct-from-array", "Votes")
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
return
}
- if zb0008 {
- (*z).Votes = nil
- } else if (*z).Votes != nil && cap((*z).Votes) >= zb0007 {
- (*z).Votes = ((*z).Votes)[:zb0007]
- } else {
- (*z).Votes = make([]voteAuthenticator, zb0007)
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = proposalSeeker{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- for zb0001 := range (*z).Votes {
- bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
+ switch string(field) {
+ case "Lowest":
+ bts, err = (*z).Lowest.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Votes", zb0001)
+ err = msgp.WrapError(err, "Lowest")
+ return
+ }
+ case "Filled":
+ (*z).Filled, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Filled")
+ return
+ }
+ case "Frozen":
+ (*z).Frozen, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Frozen")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
return
}
}
}
- if zb0003 > 0 {
- zb0003--
- var zb0009 int
- var zb0010 bool
- zb0009, zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ }
+ o = bts
+ return
+}
+
+func (_ *proposalSeeker) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalSeeker)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposalSeeker) Msgsize() (s int) {
+ s = 1 + 7 + (*z).Lowest.Msgsize() + 7 + msgp.BoolSize + 7 + msgp.BoolSize
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposalSeeker) MsgIsZero() bool {
+ return ((*z).Lowest.MsgIsZero()) && ((*z).Filled == false) && ((*z).Frozen == false)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *proposalStore) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 3
+ // string "Assemblers"
+ o = append(o, 0x83, 0xaa, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x72, 0x73)
+ if (*z).Assemblers == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Assemblers)))
+ }
+ zb0003_keys := make([]proposalValue, 0, len((*z).Assemblers))
+ for zb0003 := range (*z).Assemblers {
+ zb0003_keys = append(zb0003_keys, zb0003)
+ }
+ sort.Sort(SortProposalValue(zb0003_keys))
+ for _, zb0003 := range zb0003_keys {
+ zb0004 := (*z).Assemblers[zb0003]
+ _ = zb0004
+ o = zb0003.MarshalMsg(o)
+ o = zb0004.MarshalMsg(o)
+ }
+ // string "Pinned"
+ o = append(o, 0xa6, 0x50, 0x69, 0x6e, 0x6e, 0x65, 0x64)
+ o = (*z).Pinned.MarshalMsg(o)
+ // string "Relevant"
+ o = append(o, 0xa8, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74)
+ if (*z).Relevant == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Relevant)))
+ }
+ zb0001_keys := make([]period, 0, len((*z).Relevant))
+ for zb0001 := range (*z).Relevant {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortPeriod(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Relevant[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ o = zb0002.MarshalMsg(o)
+ }
+ return
+}
+
+func (_ *proposalStore) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalStore)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposalStore) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0005 > 0 {
+ zb0005--
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
+ err = msgp.WrapError(err, "struct-from-array", "Relevant")
return
}
- if zb0009 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0009), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
+ if zb0008 {
+ (*z).Relevant = nil
+ } else if (*z).Relevant == nil {
+ (*z).Relevant = make(map[period]proposalValue, zb0007)
+ }
+ for zb0007 > 0 {
+ var zb0001 period
+ var zb0002 proposalValue
+ zb0007--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Relevant")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Relevant", zb0001)
+ return
+ }
+ (*z).Relevant[zb0001] = zb0002
+ }
+ }
+ if zb0005 > 0 {
+ zb0005--
+ bts, err = (*z).Pinned.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Pinned")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ zb0005--
+ var zb0009 int
+ var zb0010 bool
+ zb0009, zb0010, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Assemblers")
return
}
if zb0010 {
- (*z).EquivocationVotes = nil
- } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0009 {
- (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0009]
- } else {
- (*z).EquivocationVotes = make([]equivocationVoteAuthenticator, zb0009)
+ (*z).Assemblers = nil
+ } else if (*z).Assemblers == nil {
+ (*z).Assemblers = make(map[proposalValue]blockAssembler, zb0009)
}
- for zb0002 := range (*z).EquivocationVotes {
- bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
+ for zb0009 > 0 {
+ var zb0003 proposalValue
+ var zb0004 blockAssembler
+ zb0009--
+ bts, err = zb0003.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes", zb0002)
+ err = msgp.WrapError(err, "struct-from-array", "Assemblers")
+ return
+ }
+ bts, err = zb0004.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Assemblers", zb0003)
return
}
+ (*z).Assemblers[zb0003] = zb0004
}
}
- if zb0003 > 0 {
- err = msgp.ErrTooManyArrayFields(zb0003)
+ if zb0005 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0005)
if err != nil {
err = msgp.WrapError(err, "struct-from-array")
return
@@ -4236,107 +5028,85 @@ func (z *unauthenticatedBundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
- if zb0004 {
- (*z) = unauthenticatedBundle{}
+ if zb0006 {
+ (*z) = proposalStore{}
}
- for zb0003 > 0 {
- zb0003--
+ for zb0005 > 0 {
+ zb0005--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch string(field) {
- case "rnd":
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ case "Relevant":
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Round")
+ err = msgp.WrapError(err, "Relevant")
return
}
- case "per":
- {
- var zb0011 uint64
- zb0011, bts, err = msgp.ReadUint64Bytes(bts)
+ if zb0012 {
+ (*z).Relevant = nil
+ } else if (*z).Relevant == nil {
+ (*z).Relevant = make(map[period]proposalValue, zb0011)
+ }
+ for zb0011 > 0 {
+ var zb0001 period
+ var zb0002 proposalValue
+ zb0011--
+ bts, err = zb0001.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Period")
+ err = msgp.WrapError(err, "Relevant")
return
}
- (*z).Period = period(zb0011)
- }
- case "step":
- {
- var zb0012 uint64
- zb0012, bts, err = msgp.ReadUint64Bytes(bts)
+ bts, err = zb0002.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Step")
+ err = msgp.WrapError(err, "Relevant", zb0001)
return
}
- (*z).Step = step(zb0012)
+ (*z).Relevant[zb0001] = zb0002
}
- case "prop":
- bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ case "Pinned":
+ bts, err = (*z).Pinned.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Proposal")
+ err = msgp.WrapError(err, "Pinned")
return
}
- case "vote":
+ case "Assemblers":
var zb0013 int
var zb0014 bool
- zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ zb0013, zb0014, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Votes")
- return
- }
- if zb0013 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0013), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "Votes")
+ err = msgp.WrapError(err, "Assemblers")
return
}
if zb0014 {
- (*z).Votes = nil
- } else if (*z).Votes != nil && cap((*z).Votes) >= zb0013 {
- (*z).Votes = ((*z).Votes)[:zb0013]
- } else {
- (*z).Votes = make([]voteAuthenticator, zb0013)
- }
- for zb0001 := range (*z).Votes {
- bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
+ (*z).Assemblers = nil
+ } else if (*z).Assemblers == nil {
+ (*z).Assemblers = make(map[proposalValue]blockAssembler, zb0013)
+ }
+ for zb0013 > 0 {
+ var zb0003 proposalValue
+ var zb0004 blockAssembler
+ zb0013--
+ bts, err = zb0003.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Votes", zb0001)
+ err = msgp.WrapError(err, "Assemblers")
+ return
+ }
+ bts, err = zb0004.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Assemblers", zb0003)
return
}
+ (*z).Assemblers[zb0003] = zb0004
}
- case "eqv":
- var zb0015 int
- var zb0016 bool
- zb0015, zb0016, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ default:
+ err = msgp.ErrNoField(string(field))
if err != nil {
- err = msgp.WrapError(err, "EquivocationVotes")
- return
- }
- if zb0015 > config.MaxVoteThreshold {
- err = msgp.ErrOverflow(uint64(zb0015), uint64(config.MaxVoteThreshold))
- err = msgp.WrapError(err, "EquivocationVotes")
- return
- }
- if zb0016 {
- (*z).EquivocationVotes = nil
- } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0015 {
- (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0015]
- } else {
- (*z).EquivocationVotes = make([]equivocationVoteAuthenticator, zb0015)
- }
- for zb0002 := range (*z).EquivocationVotes {
- bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "EquivocationVotes", zb0002)
- return
- }
- }
- default:
- err = msgp.ErrNoField(string(field))
- if err != nil {
- err = msgp.WrapError(err)
+ err = msgp.WrapError(err)
return
}
}
@@ -4346,118 +5116,94 @@ func (z *unauthenticatedBundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *unauthenticatedBundle) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedBundle)
+func (_ *proposalStore) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalStore)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *unauthenticatedBundle) Msgsize() (s int) {
- s = 1 + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Proposal.Msgsize() + 5 + msgp.ArrayHeaderSize
- for zb0001 := range (*z).Votes {
- s += (*z).Votes[zb0001].Msgsize()
+func (z *proposalStore) Msgsize() (s int) {
+ s = 1 + 9 + msgp.MapHeaderSize
+ if (*z).Relevant != nil {
+ for zb0001, zb0002 := range (*z).Relevant {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
+ }
}
- s += 4 + msgp.ArrayHeaderSize
- for zb0002 := range (*z).EquivocationVotes {
- s += (*z).EquivocationVotes[zb0002].Msgsize()
+ s += 7 + (*z).Pinned.Msgsize() + 11 + msgp.MapHeaderSize
+ if (*z).Assemblers != nil {
+ for zb0003, zb0004 := range (*z).Assemblers {
+ _ = zb0003
+ _ = zb0004
+ s += 0 + zb0003.Msgsize() + zb0004.Msgsize()
+ }
}
return
}
// MsgIsZero returns whether this is a zero value
-func (z *unauthenticatedBundle) MsgIsZero() bool {
- return ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Proposal.MsgIsZero()) && (len((*z).Votes) == 0) && (len((*z).EquivocationVotes) == 0)
+func (z *proposalStore) MsgIsZero() bool {
+ return (len((*z).Relevant) == 0) && ((*z).Pinned.MsgIsZero()) && (len((*z).Assemblers) == 0)
}
// MarshalMsg implements msgp.Marshaler
-func (z *unauthenticatedEquivocationVote) MarshalMsg(b []byte) (o []byte) {
+func (z *proposalTable) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
// omitempty: check for empty values
- zb0003Len := uint32(7)
- var zb0003Mask uint8 /* 8 bits */
- if (*z).Cred.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x2
- }
- if (*z).Period == 0 {
- zb0003Len--
- zb0003Mask |= 0x4
- }
- if ((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero()) {
- zb0003Len--
- zb0003Mask |= 0x8
- }
- if (*z).Round.MsgIsZero() {
- zb0003Len--
- zb0003Mask |= 0x10
- }
- if ((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()) {
- zb0003Len--
- zb0003Mask |= 0x20
- }
- if (*z).Sender.MsgIsZero() {
+ zb0003Len := uint32(2)
+ var zb0003Mask uint8 /* 3 bits */
+ if len((*z).Pending) == 0 {
zb0003Len--
- zb0003Mask |= 0x40
+ zb0003Mask |= 0x1
}
- if (*z).Step == 0 {
+ if (*z).PendingNext == 0 {
zb0003Len--
- zb0003Mask |= 0x80
+ zb0003Mask |= 0x2
}
// variable map header, size zb0003Len
o = append(o, 0x80|uint8(zb0003Len))
if zb0003Len != 0 {
- if (zb0003Mask & 0x2) == 0 { // if not empty
- // string "cred"
- o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
- o = (*z).Cred.MarshalMsg(o)
- }
- if (zb0003Mask & 0x4) == 0 { // if not empty
- // string "per"
- o = append(o, 0xa3, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).Period))
- }
- if (zb0003Mask & 0x8) == 0 { // if not empty
- // string "props"
- o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x70, 0x73)
- o = msgp.AppendArrayHeader(o, 2)
- for zb0001 := range (*z).Proposals {
- o = (*z).Proposals[zb0001].MarshalMsg(o)
+ if (zb0003Mask & 0x1) == 0 { // if not empty
+ // string "Pending"
+ o = append(o, 0xa7, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67)
+ if (*z).Pending == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Pending)))
}
- }
- if (zb0003Mask & 0x10) == 0 { // if not empty
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).Round.MarshalMsg(o)
- }
- if (zb0003Mask & 0x20) == 0 { // if not empty
- // string "sigs"
- o = append(o, 0xa4, 0x73, 0x69, 0x67, 0x73)
- o = msgp.AppendArrayHeader(o, 2)
- for zb0002 := range (*z).Sigs {
- o = (*z).Sigs[zb0002].MarshalMsg(o)
+ zb0001_keys := make([]uint64, 0, len((*z).Pending))
+ for zb0001 := range (*z).Pending {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortUint64(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Pending[zb0001]
+ _ = zb0002
+ o = msgp.AppendUint64(o, zb0001)
+ if zb0002 == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = zb0002.MarshalMsg(o)
+ }
}
}
- if (zb0003Mask & 0x40) == 0 { // if not empty
- // string "snd"
- o = append(o, 0xa3, 0x73, 0x6e, 0x64)
- o = (*z).Sender.MarshalMsg(o)
- }
- if (zb0003Mask & 0x80) == 0 { // if not empty
- // string "step"
- o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
- o = msgp.AppendUint64(o, uint64((*z).Step))
+ if (zb0003Mask & 0x2) == 0 { // if not empty
+ // string "PendingNext"
+ o = append(o, 0xab, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4e, 0x65, 0x78, 0x74)
+ o = msgp.AppendUint64(o, (*z).PendingNext)
}
}
return
}
-func (_ *unauthenticatedEquivocationVote) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedEquivocationVote)
+func (_ *proposalTable) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalTable)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *unauthenticatedEquivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *proposalTable) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0003 int
@@ -4471,91 +5217,53 @@ func (z *unauthenticatedEquivocationVote) UnmarshalMsg(bts []byte) (o []byte, er
}
if zb0003 > 0 {
zb0003--
- bts, err = (*z).Sender.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sender")
- return
- }
- }
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
+ err = msgp.WrapError(err, "struct-from-array", "Pending")
return
}
- }
- if zb0003 > 0 {
- zb0003--
- {
- var zb0005 uint64
- zb0005, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Period")
- return
- }
- (*z).Period = period(zb0005)
+ if zb0006 {
+ (*z).Pending = nil
+ } else if (*z).Pending == nil {
+ (*z).Pending = make(map[uint64]*messageEvent, zb0005)
}
- }
- if zb0003 > 0 {
- zb0003--
- {
- var zb0006 uint64
- zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ for zb0005 > 0 {
+ var zb0001 uint64
+ var zb0002 *messageEvent
+ zb0005--
+ zb0001, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Step")
+ err = msgp.WrapError(err, "struct-from-array", "Pending")
return
}
- (*z).Step = step(zb0006)
- }
- }
- if zb0003 > 0 {
- zb0003--
- bts, err = (*z).Cred.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Cred")
- return
- }
- }
- if zb0003 > 0 {
- zb0003--
- var zb0007 int
- zb0007, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposals")
- return
- }
- if zb0007 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0007}
- return
- }
- for zb0001 := 0; zb0001 < zb0007; zb0001++ {
- bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Proposals", zb0001)
- return
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(messageEvent)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Pending", zb0001)
+ return
+ }
}
+ (*z).Pending[zb0001] = zb0002
}
}
if zb0003 > 0 {
zb0003--
- var zb0008 int
- zb0008, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ (*z).PendingNext, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sigs")
- return
- }
- if zb0008 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0008}
+ err = msgp.WrapError(err, "struct-from-array", "PendingNext")
return
}
- for zb0002 := 0; zb0002 < zb0008; zb0002++ {
- bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sigs", zb0002)
- return
- }
- }
}
if zb0003 > 0 {
err = msgp.ErrTooManyArrayFields(zb0003)
@@ -4570,7 +5278,7 @@ func (z *unauthenticatedEquivocationVote) UnmarshalMsg(bts []byte) (o []byte, er
return
}
if zb0004 {
- (*z) = unauthenticatedEquivocationVote{}
+ (*z) = proposalTable{}
}
for zb0003 > 0 {
zb0003--
@@ -4580,80 +5288,52 @@ func (z *unauthenticatedEquivocationVote) UnmarshalMsg(bts []byte) (o []byte, er
return
}
switch string(field) {
- case "snd":
- bts, err = (*z).Sender.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sender")
- return
- }
- case "rnd":
- bts, err = (*z).Round.UnmarshalMsg(bts)
+ case "Pending":
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Round")
+ err = msgp.WrapError(err, "Pending")
return
}
- case "per":
- {
- var zb0009 uint64
- zb0009, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "Period")
- return
- }
- (*z).Period = period(zb0009)
+ if zb0008 {
+ (*z).Pending = nil
+ } else if (*z).Pending == nil {
+ (*z).Pending = make(map[uint64]*messageEvent, zb0007)
}
- case "step":
- {
- var zb0010 uint64
- zb0010, bts, err = msgp.ReadUint64Bytes(bts)
+ for zb0007 > 0 {
+ var zb0001 uint64
+ var zb0002 *messageEvent
+ zb0007--
+ zb0001, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Step")
+ err = msgp.WrapError(err, "Pending")
return
}
- (*z).Step = step(zb0010)
- }
- case "cred":
- bts, err = (*z).Cred.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Cred")
- return
- }
- case "props":
- var zb0011 int
- zb0011, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "Proposals")
- return
- }
- if zb0011 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0011}
- return
- }
- for zb0001 := 0; zb0001 < zb0011; zb0001++ {
- bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Proposals", zb0001)
- return
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(messageEvent)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Pending", zb0001)
+ return
+ }
}
+ (*z).Pending[zb0001] = zb0002
}
- case "sigs":
- var zb0012 int
- zb0012, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "PendingNext":
+ (*z).PendingNext, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Sigs")
- return
- }
- if zb0012 > 2 {
- err = msgp.ArrayError{Wanted: 2, Got: zb0012}
+ err = msgp.WrapError(err, "PendingNext")
return
}
- for zb0002 := 0; zb0002 < zb0012; zb0002++ {
- bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sigs", zb0002)
- return
- }
- }
default:
err = msgp.ErrNoField(string(field))
if err != nil {
@@ -4667,630 +5347,5413 @@ func (z *unauthenticatedEquivocationVote) UnmarshalMsg(bts []byte) (o []byte, er
return
}
-func (_ *unauthenticatedEquivocationVote) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedEquivocationVote)
+func (_ *proposalTable) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalTable)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *unauthenticatedEquivocationVote) Msgsize() (s int) {
- s = 1 + 4 + (*z).Sender.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Cred.Msgsize() + 6 + msgp.ArrayHeaderSize
- for zb0001 := range (*z).Proposals {
- s += (*z).Proposals[zb0001].Msgsize()
- }
- s += 5 + msgp.ArrayHeaderSize
- for zb0002 := range (*z).Sigs {
- s += (*z).Sigs[zb0002].Msgsize()
+func (z *proposalTable) Msgsize() (s int) {
+ s = 1 + 8 + msgp.MapHeaderSize
+ if (*z).Pending != nil {
+ for zb0001, zb0002 := range (*z).Pending {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + msgp.Uint64Size
+ if zb0002 == nil {
+ s += msgp.NilSize
+ } else {
+ s += zb0002.Msgsize()
+ }
+ }
}
+ s += 12 + msgp.Uint64Size
return
}
// MsgIsZero returns whether this is a zero value
-func (z *unauthenticatedEquivocationVote) MsgIsZero() bool {
- return ((*z).Sender.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Cred.MsgIsZero()) && (((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero())) && (((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()))
+func (z *proposalTable) MsgIsZero() bool {
+ return (len((*z).Pending) == 0) && ((*z).PendingNext == 0)
}
// MarshalMsg implements msgp.Marshaler
-func (z *unauthenticatedProposal) MarshalMsg(b []byte) (o []byte) {
+func (z *proposalTracker) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0004Len := uint32(29)
- var zb0004Mask uint64 /* 35 bits */
- if (*z).Block.BlockHeader.RewardsState.RewardsLevel == 0 {
- zb0004Len--
- zb0004Mask |= 0x40
- }
- if (*z).Block.BlockHeader.RewardsState.FeeSink.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x80
- }
- if (*z).Block.BlockHeader.RewardsState.RewardsResidue == 0 {
- zb0004Len--
- zb0004Mask |= 0x100
- }
- if (*z).Block.BlockHeader.GenesisID == "" {
- zb0004Len--
- zb0004Mask |= 0x200
- }
- if (*z).Block.BlockHeader.GenesisHash.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x400
- }
- if (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x800
- }
- if (*z).Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x1000
- }
- if (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x2000
- }
- if (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0 {
- zb0004Len--
- zb0004Mask |= 0x4000
- }
- if (*z).OriginalPeriod == 0 {
- zb0004Len--
- zb0004Mask |= 0x8000
- }
- if (*z).OriginalProposer.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x10000
- }
- if len((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0 {
- zb0004Len--
- zb0004Mask |= 0x20000
- }
- if (*z).Block.BlockHeader.Branch.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x40000
- }
- if (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x80000
- }
- if (*z).Block.BlockHeader.RewardsState.RewardsRate == 0 {
- zb0004Len--
- zb0004Mask |= 0x100000
- }
- if (*z).Block.BlockHeader.Round.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x200000
- }
- if (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x400000
- }
- if (*z).Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x800000
- }
- if (*z).SeedProof.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x1000000
- }
- if (*z).Block.BlockHeader.Seed.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x2000000
- }
- if len((*z).Block.BlockHeader.StateProofTracking) == 0 {
- zb0004Len--
- zb0004Mask |= 0x4000000
- }
- if (*z).Block.BlockHeader.TxnCounter == 0 {
- zb0004Len--
- zb0004Mask |= 0x8000000
- }
- if (*z).Block.BlockHeader.TimeStamp == 0 {
- zb0004Len--
- zb0004Mask |= 0x10000000
- }
- if (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x20000000
- }
- if (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x40000000
- }
- if (*z).Block.Payset.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x80000000
- }
- if (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x100000000
- }
- if (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero() {
- zb0004Len--
- zb0004Mask |= 0x200000000
- }
- if (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove == false {
- zb0004Len--
- zb0004Mask |= 0x400000000
- }
- // variable map header, size zb0004Len
- o = msgp.AppendMapHeader(o, zb0004Len)
- if zb0004Len != 0 {
- if (zb0004Mask & 0x40) == 0 { // if not empty
- // string "earn"
- o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e)
- o = msgp.AppendUint64(o, (*z).Block.BlockHeader.RewardsState.RewardsLevel)
- }
- if (zb0004Mask & 0x80) == 0 { // if not empty
- // string "fees"
- o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73)
- o = (*z).Block.BlockHeader.RewardsState.FeeSink.MarshalMsg(o)
- }
- if (zb0004Mask & 0x100) == 0 { // if not empty
- // string "frac"
- o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63)
- o = msgp.AppendUint64(o, (*z).Block.BlockHeader.RewardsState.RewardsResidue)
- }
- if (zb0004Mask & 0x200) == 0 { // if not empty
- // string "gen"
- o = append(o, 0xa3, 0x67, 0x65, 0x6e)
- o = msgp.AppendString(o, (*z).Block.BlockHeader.GenesisID)
- }
- if (zb0004Mask & 0x400) == 0 { // if not empty
- // string "gh"
- o = append(o, 0xa2, 0x67, 0x68)
- o = (*z).Block.BlockHeader.GenesisHash.MarshalMsg(o)
+ // map header, size 3
+ // string "Duplicate"
+ o = append(o, 0x83, 0xa9, 0x44, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65)
+ if (*z).Duplicate == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Duplicate)))
+ }
+ zb0001_keys := make([]basics.Address, 0, len((*z).Duplicate))
+ for zb0001 := range (*z).Duplicate {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortAddress(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Duplicate[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ o = msgp.AppendBool(o, zb0002)
+ }
+ // string "Freezer"
+ o = append(o, 0xa7, 0x46, 0x72, 0x65, 0x65, 0x7a, 0x65, 0x72)
+ o = (*z).Freezer.MarshalMsg(o)
+ // string "Staging"
+ o = append(o, 0xa7, 0x53, 0x74, 0x61, 0x67, 0x69, 0x6e, 0x67)
+ o = (*z).Staging.MarshalMsg(o)
+ return
+}
+
+func (_ *proposalTracker) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalTracker)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposalTracker) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if (zb0004Mask & 0x800) == 0 { // if not empty
- // string "nextbefore"
- o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65)
- o = (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MarshalMsg(o)
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Duplicate")
+ return
+ }
+ if zb0006 {
+ (*z).Duplicate = nil
+ } else if (*z).Duplicate == nil {
+ (*z).Duplicate = make(map[basics.Address]bool, zb0005)
+ }
+ for zb0005 > 0 {
+ var zb0001 basics.Address
+ var zb0002 bool
+ zb0005--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Duplicate")
+ return
+ }
+ zb0002, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Duplicate", zb0001)
+ return
+ }
+ (*z).Duplicate[zb0001] = zb0002
+ }
}
- if (zb0004Mask & 0x1000) == 0 { // if not empty
- // string "nextproto"
- o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f)
- o = (*z).Block.BlockHeader.UpgradeState.NextProtocol.MarshalMsg(o)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Freezer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Freezer")
+ return
+ }
}
- if (zb0004Mask & 0x2000) == 0 { // if not empty
- // string "nextswitch"
- o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68)
- o = (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MarshalMsg(o)
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Staging.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Staging")
+ return
+ }
}
- if (zb0004Mask & 0x4000) == 0 { // if not empty
- // string "nextyes"
- o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73)
- o = msgp.AppendUint64(o, (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals)
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
}
- if (zb0004Mask & 0x8000) == 0 { // if not empty
- // string "oper"
- o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
- o = msgp.AppendUint64(o, uint64((*z).OriginalPeriod))
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if (zb0004Mask & 0x10000) == 0 { // if not empty
- // string "oprop"
- o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).OriginalProposer.MarshalMsg(o)
+ if zb0004 {
+ (*z) = proposalTracker{}
}
- if (zb0004Mask & 0x20000) == 0 { // if not empty
- // string "partupdrmv"
- o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76)
- if (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendArrayHeader(o, uint32(len((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)))
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- o = (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o)
+ switch string(field) {
+ case "Duplicate":
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Duplicate")
+ return
+ }
+ if zb0008 {
+ (*z).Duplicate = nil
+ } else if (*z).Duplicate == nil {
+ (*z).Duplicate = make(map[basics.Address]bool, zb0007)
+ }
+ for zb0007 > 0 {
+ var zb0001 basics.Address
+ var zb0002 bool
+ zb0007--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Duplicate")
+ return
+ }
+ zb0002, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Duplicate", zb0001)
+ return
+ }
+ (*z).Duplicate[zb0001] = zb0002
+ }
+ case "Freezer":
+ bts, err = (*z).Freezer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Freezer")
+ return
+ }
+ case "Staging":
+ bts, err = (*z).Staging.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Staging")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
}
}
- if (zb0004Mask & 0x40000) == 0 { // if not empty
- // string "prev"
- o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76)
- o = (*z).Block.BlockHeader.Branch.MarshalMsg(o)
+ }
+ o = bts
+ return
+}
+
+func (_ *proposalTracker) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalTracker)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposalTracker) Msgsize() (s int) {
+ s = 1 + 10 + msgp.MapHeaderSize
+ if (*z).Duplicate != nil {
+ for zb0001, zb0002 := range (*z).Duplicate {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize() + msgp.BoolSize
}
- if (zb0004Mask & 0x80000) == 0 { // if not empty
- // string "proto"
- o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f)
- o = (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.MarshalMsg(o)
+ }
+ s += 8 + (*z).Freezer.Msgsize() + 8 + (*z).Staging.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposalTracker) MsgIsZero() bool {
+ return (len((*z).Duplicate) == 0) && ((*z).Freezer.MsgIsZero()) && ((*z).Staging.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *proposalTrackerContract) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 4
+ // string "Froze"
+ o = append(o, 0x84, 0xa5, 0x46, 0x72, 0x6f, 0x7a, 0x65)
+ o = msgp.AppendBool(o, (*z).Froze)
+ // string "SawCertThreshold"
+ o = append(o, 0xb0, 0x53, 0x61, 0x77, 0x43, 0x65, 0x72, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64)
+ o = msgp.AppendBool(o, (*z).SawCertThreshold)
+ // string "SawOneVote"
+ o = append(o, 0xaa, 0x53, 0x61, 0x77, 0x4f, 0x6e, 0x65, 0x56, 0x6f, 0x74, 0x65)
+ o = msgp.AppendBool(o, (*z).SawOneVote)
+ // string "SawSoftThreshold"
+ o = append(o, 0xb0, 0x53, 0x61, 0x77, 0x53, 0x6f, 0x66, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64)
+ o = msgp.AppendBool(o, (*z).SawSoftThreshold)
+ return
+}
+
+func (_ *proposalTrackerContract) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalTrackerContract)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposalTrackerContract) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if (zb0004Mask & 0x100000) == 0 { // if not empty
- // string "rate"
- o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65)
- o = msgp.AppendUint64(o, (*z).Block.BlockHeader.RewardsState.RewardsRate)
+ if zb0001 > 0 {
+ zb0001--
+ (*z).SawOneVote, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "SawOneVote")
+ return
+ }
}
- if (zb0004Mask & 0x200000) == 0 { // if not empty
- // string "rnd"
- o = append(o, 0xa3, 0x72, 0x6e, 0x64)
- o = (*z).Block.BlockHeader.Round.MarshalMsg(o)
+ if zb0001 > 0 {
+ zb0001--
+ (*z).Froze, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Froze")
+ return
+ }
}
- if (zb0004Mask & 0x400000) == 0 { // if not empty
- // string "rwcalr"
- o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72)
- o = (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.MarshalMsg(o)
+ if zb0001 > 0 {
+ zb0001--
+ (*z).SawSoftThreshold, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "SawSoftThreshold")
+ return
+ }
}
- if (zb0004Mask & 0x800000) == 0 { // if not empty
- // string "rwd"
- o = append(o, 0xa3, 0x72, 0x77, 0x64)
- o = (*z).Block.BlockHeader.RewardsState.RewardsPool.MarshalMsg(o)
+ if zb0001 > 0 {
+ zb0001--
+ (*z).SawCertThreshold, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "SawCertThreshold")
+ return
+ }
}
- if (zb0004Mask & 0x1000000) == 0 { // if not empty
- // string "sdpf"
- o = append(o, 0xa4, 0x73, 0x64, 0x70, 0x66)
- o = (*z).SeedProof.MarshalMsg(o)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
}
- if (zb0004Mask & 0x2000000) == 0 { // if not empty
- // string "seed"
- o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
- o = (*z).Block.BlockHeader.Seed.MarshalMsg(o)
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- if (zb0004Mask & 0x4000000) == 0 { // if not empty
- // string "spt"
- o = append(o, 0xa3, 0x73, 0x70, 0x74)
- if (*z).Block.BlockHeader.StateProofTracking == nil {
- o = msgp.AppendNil(o)
- } else {
- o = msgp.AppendMapHeader(o, uint32(len((*z).Block.BlockHeader.StateProofTracking)))
+ if zb0002 {
+ (*z) = proposalTrackerContract{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
- zb0001_keys := make([]protocol.StateProofType, 0, len((*z).Block.BlockHeader.StateProofTracking))
- for zb0001 := range (*z).Block.BlockHeader.StateProofTracking {
- zb0001_keys = append(zb0001_keys, zb0001)
+ switch string(field) {
+ case "SawOneVote":
+ (*z).SawOneVote, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "SawOneVote")
+ return
+ }
+ case "Froze":
+ (*z).Froze, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Froze")
+ return
+ }
+ case "SawSoftThreshold":
+ (*z).SawSoftThreshold, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "SawSoftThreshold")
+ return
+ }
+ case "SawCertThreshold":
+ (*z).SawCertThreshold, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "SawCertThreshold")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
}
- sort.Sort(protocol.SortStateProofType(zb0001_keys))
- for _, zb0001 := range zb0001_keys {
- zb0002 := (*z).Block.BlockHeader.StateProofTracking[zb0001]
- _ = zb0002
- o = zb0001.MarshalMsg(o)
- o = zb0002.MarshalMsg(o)
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *proposalTrackerContract) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalTrackerContract)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposalTrackerContract) Msgsize() (s int) {
+ s = 1 + 11 + msgp.BoolSize + 6 + msgp.BoolSize + 17 + msgp.BoolSize + 17 + msgp.BoolSize
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposalTrackerContract) MsgIsZero() bool {
+ return ((*z).SawOneVote == false) && ((*z).Froze == false) && ((*z).SawSoftThreshold == false) && ((*z).SawCertThreshold == false)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *proposalValue) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0001Len := uint32(4)
+ var zb0001Mask uint8 /* 5 bits */
+ if (*z).BlockDigest.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x2
+ }
+ if (*z).EncodingDigest.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x4
+ }
+ if (*z).OriginalPeriod == 0 {
+ zb0001Len--
+ zb0001Mask |= 0x8
+ }
+ if (*z).OriginalProposer.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x10
+ }
+ // variable map header, size zb0001Len
+ o = append(o, 0x80|uint8(zb0001Len))
+ if zb0001Len != 0 {
+ if (zb0001Mask & 0x2) == 0 { // if not empty
+ // string "dig"
+ o = append(o, 0xa3, 0x64, 0x69, 0x67)
+ o = (*z).BlockDigest.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x4) == 0 { // if not empty
+ // string "encdig"
+ o = append(o, 0xa6, 0x65, 0x6e, 0x63, 0x64, 0x69, 0x67)
+ o = (*z).EncodingDigest.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x8) == 0 { // if not empty
+ // string "oper"
+ o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).OriginalPeriod))
+ }
+ if (zb0001Mask & 0x10) == 0 { // if not empty
+ // string "oprop"
+ o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).OriginalProposer.MarshalMsg(o)
+ }
+ }
+ return
+}
+
+func (_ *proposalValue) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalValue)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposalValue) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0003 uint64
+ zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "OriginalPeriod")
+ return
+ }
+ (*z).OriginalPeriod = period(zb0003)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "OriginalProposer")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).BlockDigest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "BlockDigest")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).EncodingDigest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "EncodingDigest")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = proposalValue{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "oper":
+ {
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "OriginalPeriod")
+ return
+ }
+ (*z).OriginalPeriod = period(zb0004)
+ }
+ case "oprop":
+ bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "OriginalProposer")
+ return
+ }
+ case "dig":
+ bts, err = (*z).BlockDigest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "BlockDigest")
+ return
+ }
+ case "encdig":
+ bts, err = (*z).EncodingDigest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "EncodingDigest")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *proposalValue) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalValue)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposalValue) Msgsize() (s int) {
+ s = 1 + 5 + msgp.Uint64Size + 6 + (*z).OriginalProposer.Msgsize() + 4 + (*z).BlockDigest.Msgsize() + 7 + (*z).EncodingDigest.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposalValue) MsgIsZero() bool {
+ return ((*z).OriginalPeriod == 0) && ((*z).OriginalProposer.MsgIsZero()) && ((*z).BlockDigest.MsgIsZero()) && ((*z).EncodingDigest.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *proposalVoteCounter) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 2
+ // string "Count"
+ o = append(o, 0x82, 0xa5, 0x43, 0x6f, 0x75, 0x6e, 0x74)
+ o = msgp.AppendUint64(o, (*z).Count)
+ // string "Votes"
+ o = append(o, 0xa5, 0x56, 0x6f, 0x74, 0x65, 0x73)
+ if (*z).Votes == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Votes)))
+ }
+ zb0001_keys := make([]basics.Address, 0, len((*z).Votes))
+ for zb0001 := range (*z).Votes {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortAddress(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Votes[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ o = zb0002.MarshalMsg(o)
+ }
+ return
+}
+
+func (_ *proposalVoteCounter) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalVoteCounter)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposalVoteCounter) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ (*z).Count, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Count")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Votes")
+ return
+ }
+ if zb0006 {
+ (*z).Votes = nil
+ } else if (*z).Votes == nil {
+ (*z).Votes = make(map[basics.Address]vote, zb0005)
+ }
+ for zb0005 > 0 {
+ var zb0001 basics.Address
+ var zb0002 vote
+ zb0005--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Votes")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Votes", zb0001)
+ return
+ }
+ (*z).Votes[zb0001] = zb0002
+ }
+ }
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 {
+ (*z) = proposalVoteCounter{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "Count":
+ (*z).Count, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Count")
+ return
+ }
+ case "Votes":
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Votes")
+ return
+ }
+ if zb0008 {
+ (*z).Votes = nil
+ } else if (*z).Votes == nil {
+ (*z).Votes = make(map[basics.Address]vote, zb0007)
+ }
+ for zb0007 > 0 {
+ var zb0001 basics.Address
+ var zb0002 vote
+ zb0007--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Votes")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Votes", zb0001)
+ return
+ }
+ (*z).Votes[zb0001] = zb0002
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *proposalVoteCounter) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposalVoteCounter)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposalVoteCounter) Msgsize() (s int) {
+ s = 1 + 6 + msgp.Uint64Size + 6 + msgp.MapHeaderSize
+ if (*z).Votes != nil {
+ for zb0001, zb0002 := range (*z).Votes {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
+ }
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposalVoteCounter) MsgIsZero() bool {
+ return ((*z).Count == 0) && (len((*z).Votes) == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *proposerSeed) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 2
+ // string "addr"
+ o = append(o, 0x82, 0xa4, 0x61, 0x64, 0x64, 0x72)
+ o = (*z).Addr.MarshalMsg(o)
+ // string "vrf"
+ o = append(o, 0xa3, 0x76, 0x72, 0x66)
+ o = (*z).VRF.MarshalMsg(o)
+ return
+}
+
+func (_ *proposerSeed) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposerSeed)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *proposerSeed) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Addr.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Addr")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).VRF.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VRF")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = proposerSeed{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "addr":
+ bts, err = (*z).Addr.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Addr")
+ return
+ }
+ case "vrf":
+ bts, err = (*z).VRF.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VRF")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *proposerSeed) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*proposerSeed)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *proposerSeed) Msgsize() (s int) {
+ s = 1 + 5 + (*z).Addr.Msgsize() + 4 + (*z).VRF.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *proposerSeed) MsgIsZero() bool {
+ return ((*z).Addr.MsgIsZero()) && ((*z).VRF.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *rawVote) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0001Len := uint32(5)
+ var zb0001Mask uint8 /* 6 bits */
+ if (*z).Period == 0 {
+ zb0001Len--
+ zb0001Mask |= 0x2
+ }
+ if (*z).Proposal.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x4
+ }
+ if (*z).Round.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x8
+ }
+ if (*z).Sender.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x10
+ }
+ if (*z).Step == 0 {
+ zb0001Len--
+ zb0001Mask |= 0x20
+ }
+ // variable map header, size zb0001Len
+ o = append(o, 0x80|uint8(zb0001Len))
+ if zb0001Len != 0 {
+ if (zb0001Mask & 0x2) == 0 { // if not empty
+ // string "per"
+ o = append(o, 0xa3, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
+ }
+ if (zb0001Mask & 0x4) == 0 { // if not empty
+ // string "prop"
+ o = append(o, 0xa4, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).Proposal.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x8) == 0 { // if not empty
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x10) == 0 { // if not empty
+ // string "snd"
+ o = append(o, 0xa3, 0x73, 0x6e, 0x64)
+ o = (*z).Sender.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x20) == 0 { // if not empty
+ // string "step"
+ o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
+ }
+ }
+ return
+}
+
+func (_ *rawVote) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*rawVote)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *rawVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sender")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0003 uint64
+ zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0003)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0004)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = rawVote{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "snd":
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sender")
+ return
+ }
+ case "rnd":
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "per":
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Period")
+ return
+ }
+ (*z).Period = period(zb0005)
+ }
+ case "step":
+ {
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0006)
+ }
+ case "prop":
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposal")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *rawVote) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*rawVote)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *rawVote) Msgsize() (s int) {
+ s = 1 + 4 + (*z).Sender.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Proposal.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *rawVote) MsgIsZero() bool {
+ return ((*z).Sender.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Proposal.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *rootRouter) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 3
+ // string "Children"
+ o = append(o, 0x83, 0xa8, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e)
+ if (*z).Children == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Children)))
+ }
+ zb0001_keys := make([]round, 0, len((*z).Children))
+ for zb0001 := range (*z).Children {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortRound(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Children[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ if zb0002 == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = zb0002.MarshalMsg(o)
+ }
+ }
+ // string "ProposalManager"
+ o = append(o, 0xaf, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72)
+ // map header, size 0
+ o = append(o, 0x80)
+ // string "VoteAggregator"
+ o = append(o, 0xae, 0x56, 0x6f, 0x74, 0x65, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72)
+ // map header, size 0
+ o = append(o, 0x80)
+ return
+}
+
+func (_ *rootRouter) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*rootRouter)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *rootRouter) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalManager")
+ return
+ }
+ if zb0005 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0005)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalManager", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalManager")
+ return
+ }
+ if zb0006 {
+ (*z).ProposalManager = proposalManager{}
+ }
+ for zb0005 > 0 {
+ zb0005--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalManager")
+ return
+ }
+ switch string(field) {
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalManager")
+ return
+ }
+ }
+ }
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0007, zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteAggregator")
+ return
+ }
+ if zb0007 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0007)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteAggregator", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteAggregator")
+ return
+ }
+ if zb0008 {
+ (*z).VoteAggregator = voteAggregator{}
+ }
+ for zb0007 > 0 {
+ zb0007--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteAggregator")
+ return
+ }
+ switch string(field) {
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteAggregator")
+ return
+ }
+ }
+ }
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0009 int
+ var zb0010 bool
+ zb0009, zb0010, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children")
+ return
+ }
+ if zb0010 {
+ (*z).Children = nil
+ } else if (*z).Children == nil {
+ (*z).Children = make(map[round]*roundRouter, zb0009)
+ }
+ for zb0009 > 0 {
+ var zb0001 round
+ var zb0002 *roundRouter
+ zb0009--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children")
+ return
+ }
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(roundRouter)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children", zb0001)
+ return
+ }
+ }
+ (*z).Children[zb0001] = zb0002
+ }
+ }
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 {
+ (*z) = rootRouter{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "ProposalManager":
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0011, zb0012, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalManager")
+ return
+ }
+ if zb0011 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0011)
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalManager", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalManager")
+ return
+ }
+ if zb0012 {
+ (*z).ProposalManager = proposalManager{}
+ }
+ for zb0011 > 0 {
+ zb0011--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalManager")
+ return
+ }
+ switch string(field) {
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalManager")
+ return
+ }
+ }
+ }
+ }
+ case "VoteAggregator":
+ var zb0013 int
+ var zb0014 bool
+ zb0013, zb0014, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteAggregator")
+ return
+ }
+ if zb0013 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0013)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteAggregator", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "VoteAggregator")
+ return
+ }
+ if zb0014 {
+ (*z).VoteAggregator = voteAggregator{}
+ }
+ for zb0013 > 0 {
+ zb0013--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteAggregator")
+ return
+ }
+ switch string(field) {
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "VoteAggregator")
+ return
+ }
+ }
+ }
+ }
+ case "Children":
+ var zb0015 int
+ var zb0016 bool
+ zb0015, zb0016, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children")
+ return
+ }
+ if zb0016 {
+ (*z).Children = nil
+ } else if (*z).Children == nil {
+ (*z).Children = make(map[round]*roundRouter, zb0015)
+ }
+ for zb0015 > 0 {
+ var zb0001 round
+ var zb0002 *roundRouter
+ zb0015--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children")
+ return
+ }
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(roundRouter)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children", zb0001)
+ return
+ }
+ }
+ (*z).Children[zb0001] = zb0002
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *rootRouter) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*rootRouter)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *rootRouter) Msgsize() (s int) {
+ s = 1 + 16 + 1 + 15 + 1 + 9 + msgp.MapHeaderSize
+ if (*z).Children != nil {
+ for zb0001, zb0002 := range (*z).Children {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize()
+ if zb0002 == nil {
+ s += msgp.NilSize
+ } else {
+ s += zb0002.Msgsize()
+ }
+ }
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *rootRouter) MsgIsZero() bool {
+ return (len((*z).Children) == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *roundRouter) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 3
+ // string "Children"
+ o = append(o, 0x83, 0xa8, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e)
+ if (*z).Children == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Children)))
+ }
+ zb0001_keys := make([]period, 0, len((*z).Children))
+ for zb0001 := range (*z).Children {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortPeriod(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Children[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ if zb0002 == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = zb0002.MarshalMsg(o)
+ }
+ }
+ // string "ProposalStore"
+ o = append(o, 0xad, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65)
+ o = (*z).ProposalStore.MarshalMsg(o)
+ // string "VoteTrackerRound"
+ o = append(o, 0xb0, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x52, 0x6f, 0x75, 0x6e, 0x64)
+ // map header, size 2
+ // string "Freshest"
+ o = append(o, 0x82, 0xa8, 0x46, 0x72, 0x65, 0x73, 0x68, 0x65, 0x73, 0x74)
+ o = (*z).VoteTrackerRound.Freshest.MarshalMsg(o)
+ // string "Ok"
+ o = append(o, 0xa2, 0x4f, 0x6b)
+ o = msgp.AppendBool(o, (*z).VoteTrackerRound.Ok)
+ return
+}
+
+func (_ *roundRouter) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*roundRouter)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *roundRouter) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).ProposalStore.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ProposalStore")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound")
+ return
+ }
+ if zb0005 > 0 {
+ zb0005--
+ bts, err = (*z).VoteTrackerRound.Freshest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound", "struct-from-array", "Freshest")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ zb0005--
+ (*z).VoteTrackerRound.Ok, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound", "struct-from-array", "Ok")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0005)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound")
+ return
+ }
+ if zb0006 {
+ (*z).VoteTrackerRound = voteTrackerRound{}
+ }
+ for zb0005 > 0 {
+ zb0005--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound")
+ return
+ }
+ switch string(field) {
+ case "Freshest":
+ bts, err = (*z).VoteTrackerRound.Freshest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound", "Freshest")
+ return
+ }
+ case "Ok":
+ (*z).VoteTrackerRound.Ok, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound", "Ok")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerRound")
+ return
+ }
+ }
+ }
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children")
+ return
+ }
+ if zb0008 {
+ (*z).Children = nil
+ } else if (*z).Children == nil {
+ (*z).Children = make(map[period]*periodRouter, zb0007)
+ }
+ for zb0007 > 0 {
+ var zb0001 period
+ var zb0002 *periodRouter
+ zb0007--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children")
+ return
+ }
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(periodRouter)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Children", zb0001)
+ return
+ }
+ }
+ (*z).Children[zb0001] = zb0002
+ }
+ }
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 {
+ (*z) = roundRouter{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "ProposalStore":
+ bts, err = (*z).ProposalStore.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ProposalStore")
+ return
+ }
+ case "VoteTrackerRound":
+ var zb0009 int
+ var zb0010 bool
+ zb0009, zb0010, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0009, zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound")
+ return
+ }
+ if zb0009 > 0 {
+ zb0009--
+ bts, err = (*z).VoteTrackerRound.Freshest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound", "struct-from-array", "Freshest")
+ return
+ }
+ }
+ if zb0009 > 0 {
+ zb0009--
+ (*z).VoteTrackerRound.Ok, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound", "struct-from-array", "Ok")
+ return
+ }
+ }
+ if zb0009 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0009)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound")
+ return
+ }
+ if zb0010 {
+ (*z).VoteTrackerRound = voteTrackerRound{}
+ }
+ for zb0009 > 0 {
+ zb0009--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound")
+ return
+ }
+ switch string(field) {
+ case "Freshest":
+ bts, err = (*z).VoteTrackerRound.Freshest.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound", "Freshest")
+ return
+ }
+ case "Ok":
+ (*z).VoteTrackerRound.Ok, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound", "Ok")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerRound")
+ return
+ }
+ }
+ }
+ }
+ case "Children":
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children")
+ return
+ }
+ if zb0012 {
+ (*z).Children = nil
+ } else if (*z).Children == nil {
+ (*z).Children = make(map[period]*periodRouter, zb0011)
+ }
+ for zb0011 > 0 {
+ var zb0001 period
+ var zb0002 *periodRouter
+ zb0011--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children")
+ return
+ }
+ if msgp.IsNil(bts) {
+ bts, err = msgp.ReadNilBytes(bts)
+ if err != nil {
+ return
+ }
+ zb0002 = nil
+ } else {
+ if zb0002 == nil {
+ zb0002 = new(periodRouter)
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Children", zb0001)
+ return
+ }
+ }
+ (*z).Children[zb0001] = zb0002
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *roundRouter) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*roundRouter)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *roundRouter) Msgsize() (s int) {
+ s = 1 + 14 + (*z).ProposalStore.Msgsize() + 17 + 1 + 9 + (*z).VoteTrackerRound.Freshest.Msgsize() + 3 + msgp.BoolSize + 9 + msgp.MapHeaderSize
+ if (*z).Children != nil {
+ for zb0001, zb0002 := range (*z).Children {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize()
+ if zb0002 == nil {
+ s += msgp.NilSize
+ } else {
+ s += zb0002.Msgsize()
+ }
+ }
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *roundRouter) MsgIsZero() bool {
+ return ((*z).ProposalStore.MsgIsZero()) && (((*z).VoteTrackerRound.Freshest.MsgIsZero()) && ((*z).VoteTrackerRound.Ok == false)) && (len((*z).Children) == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *seedInput) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 2
+ // string "alpha"
+ o = append(o, 0x82, 0xa5, 0x61, 0x6c, 0x70, 0x68, 0x61)
+ o = (*z).Alpha.MarshalMsg(o)
+ // string "hist"
+ o = append(o, 0xa4, 0x68, 0x69, 0x73, 0x74)
+ o = (*z).History.MarshalMsg(o)
+ return
+}
+
+func (_ *seedInput) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*seedInput)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *seedInput) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Alpha.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Alpha")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).History.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "History")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = seedInput{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "alpha":
+ bts, err = (*z).Alpha.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Alpha")
+ return
+ }
+ case "hist":
+ bts, err = (*z).History.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "History")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *seedInput) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*seedInput)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *seedInput) Msgsize() (s int) {
+ s = 1 + 6 + (*z).Alpha.Msgsize() + 5 + (*z).History.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *seedInput) MsgIsZero() bool {
+ return ((*z).Alpha.MsgIsZero()) && ((*z).History.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *selector) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 4
+ // string "per"
+ o = append(o, 0x84, 0xa3, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
+ // string "seed"
+ o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
+ o = (*z).Seed.MarshalMsg(o)
+ // string "step"
+ o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
+ return
+}
+
+func (_ *selector) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*selector)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *selector) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Seed.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Seed")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0003 uint64
+ zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0003)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0004)
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = selector{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "seed":
+ bts, err = (*z).Seed.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Seed")
+ return
+ }
+ case "rnd":
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "per":
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Period")
+ return
+ }
+ (*z).Period = period(zb0005)
+ }
+ case "step":
+ {
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0006)
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *selector) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*selector)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *selector) Msgsize() (s int) {
+ s = 1 + 5 + (*z).Seed.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *selector) MsgIsZero() bool {
+ return ((*z).Seed.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z serializableError) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ o = msgp.AppendString(o, string(z))
+ return
+}
+
+func (_ serializableError) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(serializableError)
+ if !ok {
+ _, ok = (z).(*serializableError)
+ }
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *serializableError) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ {
+ var zb0001 string
+ zb0001, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ (*z) = serializableError(zb0001)
+ }
+ o = bts
+ return
+}
+
+func (_ *serializableError) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*serializableError)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z serializableError) Msgsize() (s int) {
+ s = msgp.StringPrefixSize + len(string(z))
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z serializableError) MsgIsZero() bool {
+ return z == ""
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z step) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ o = msgp.AppendUint64(o, uint64(z))
+ return
+}
+
+func (_ step) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(step)
+ if !ok {
+ _, ok = (z).(*step)
+ }
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *step) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ {
+ var zb0001 uint64
+ zb0001, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ (*z) = step(zb0001)
+ }
+ o = bts
+ return
+}
+
+func (_ *step) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*step)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z step) Msgsize() (s int) {
+ s = msgp.Uint64Size
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z step) MsgIsZero() bool {
+ return z == 0
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *stepRouter) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 2
+ // string "VoteTracker"
+ o = append(o, 0x82, 0xab, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72)
+ o = (*z).VoteTracker.MarshalMsg(o)
+ // string "VoteTrackerContract"
+ o = append(o, 0xb3, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74)
+ o = (*z).VoteTrackerContract.MarshalMsg(o)
+ return
+}
+
+func (_ *stepRouter) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*stepRouter)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *stepRouter) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).VoteTracker.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTracker")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).VoteTrackerContract.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "VoteTrackerContract")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = stepRouter{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "VoteTracker":
+ bts, err = (*z).VoteTracker.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTracker")
+ return
+ }
+ case "VoteTrackerContract":
+ bts, err = (*z).VoteTrackerContract.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "VoteTrackerContract")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *stepRouter) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*stepRouter)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *stepRouter) Msgsize() (s int) {
+ s = 1 + 12 + (*z).VoteTracker.Msgsize() + 20 + (*z).VoteTrackerContract.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *stepRouter) MsgIsZero() bool {
+ return ((*z).VoteTracker.MsgIsZero()) && ((*z).VoteTrackerContract.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *thresholdEvent) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 7
+ // string "Bundle"
+ o = append(o, 0x87, 0xa6, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65)
+ o = (*z).Bundle.MarshalMsg(o)
+ // string "Period"
+ o = append(o, 0xa6, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
+ // string "Proposal"
+ o = append(o, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).Proposal.MarshalMsg(o)
+ // string "Proto"
+ o = append(o, 0xa5, 0x50, 0x72, 0x6f, 0x74, 0x6f)
+ o = (*z).Proto.MarshalMsg(o)
+ // string "Round"
+ o = append(o, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
+ // string "Step"
+ o = append(o, 0xa4, 0x53, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
+ // string "T"
+ o = append(o, 0xa1, 0x54)
+ o = msgp.AppendUint8(o, uint8((*z).T))
+ return
+}
+
+func (_ *thresholdEvent) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*thresholdEvent)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *thresholdEvent) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0003 uint8
+ zb0003, bts, err = msgp.ReadUint8Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "T")
+ return
+ }
+ (*z).T = eventType(zb0003)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0004)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0005)
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Bundle.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Bundle")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Proto.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proto")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = thresholdEvent{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "T":
+ {
+ var zb0006 uint8
+ zb0006, bts, err = msgp.ReadUint8Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "T")
+ return
+ }
+ (*z).T = eventType(zb0006)
+ }
+ case "Round":
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "Period":
+ {
+ var zb0007 uint64
+ zb0007, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Period")
+ return
+ }
+ (*z).Period = period(zb0007)
+ }
+ case "Step":
+ {
+ var zb0008 uint64
+ zb0008, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0008)
+ }
+ case "Proposal":
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposal")
+ return
+ }
+ case "Bundle":
+ bts, err = (*z).Bundle.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Bundle")
+ return
+ }
+ case "Proto":
+ bts, err = (*z).Proto.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proto")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *thresholdEvent) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*thresholdEvent)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *thresholdEvent) Msgsize() (s int) {
+ s = 1 + 2 + msgp.Uint8Size + 6 + (*z).Round.Msgsize() + 7 + msgp.Uint64Size + 5 + msgp.Uint64Size + 9 + (*z).Proposal.Msgsize() + 7 + (*z).Bundle.Msgsize() + 6 + (*z).Proto.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *thresholdEvent) MsgIsZero() bool {
+ return ((*z).T == 0) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Proposal.MsgIsZero()) && ((*z).Bundle.MsgIsZero()) && ((*z).Proto.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *transmittedPayload) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0004Len := uint32(30)
+ var zb0004Mask uint64 /* 37 bits */
+ if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x80
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x100
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x200
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "" {
+ zb0004Len--
+ zb0004Mask |= 0x400
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x800
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x1000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x2000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x4000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x8000
+ }
+ if (*z).unauthenticatedProposal.OriginalPeriod == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x10000
+ }
+ if (*z).unauthenticatedProposal.OriginalProposer.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x20000
+ }
+ if len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x40000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x80000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x100000
+ }
+ if (*z).PriorVote.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x200000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x400000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x800000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x1000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x2000000
+ }
+ if (*z).unauthenticatedProposal.SeedProof.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x4000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x8000000
+ }
+ if len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x10000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x20000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x40000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x80000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x100000000
+ }
+ if (*z).unauthenticatedProposal.Block.Payset.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x200000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x400000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x800000000
+ }
+ if (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false {
+ zb0004Len--
+ zb0004Mask |= 0x1000000000
+ }
+ // variable map header, size zb0004Len
+ o = msgp.AppendMapHeader(o, zb0004Len)
+ if zb0004Len != 0 {
+ if (zb0004Mask & 0x80) == 0 { // if not empty
+ // string "earn"
+ o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e)
+ o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel)
+ }
+ if (zb0004Mask & 0x100) == 0 { // if not empty
+ // string "fees"
+ o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x200) == 0 { // if not empty
+ // string "frac"
+ o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63)
+ o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue)
+ }
+ if (zb0004Mask & 0x400) == 0 { // if not empty
+ // string "gen"
+ o = append(o, 0xa3, 0x67, 0x65, 0x6e)
+ o = msgp.AppendString(o, (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID)
+ }
+ if (zb0004Mask & 0x800) == 0 { // if not empty
+ // string "gh"
+ o = append(o, 0xa2, 0x67, 0x68)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x1000) == 0 { // if not empty
+ // string "nextbefore"
+ o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x2000) == 0 { // if not empty
+ // string "nextproto"
+ o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x4000) == 0 { // if not empty
+ // string "nextswitch"
+ o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x8000) == 0 { // if not empty
+ // string "nextyes"
+ o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73)
+ o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals)
+ }
+ if (zb0004Mask & 0x10000) == 0 { // if not empty
+ // string "oper"
+ o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).unauthenticatedProposal.OriginalPeriod))
+ }
+ if (zb0004Mask & 0x20000) == 0 { // if not empty
+ // string "oprop"
+ o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).unauthenticatedProposal.OriginalProposer.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x40000) == 0 { // if not empty
+ // string "partupdrmv"
+ o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76)
+ if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)))
+ }
+ for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o)
+ }
+ }
+ if (zb0004Mask & 0x80000) == 0 { // if not empty
+ // string "prev"
+ o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x100000) == 0 { // if not empty
+ // string "proto"
+ o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x200000) == 0 { // if not empty
+ // string "pv"
+ o = append(o, 0xa2, 0x70, 0x76)
+ o = (*z).PriorVote.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x400000) == 0 { // if not empty
+ // string "rate"
+ o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65)
+ o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate)
+ }
+ if (zb0004Mask & 0x800000) == 0 { // if not empty
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.Round.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x1000000) == 0 { // if not empty
+ // string "rwcalr"
+ o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x2000000) == 0 { // if not empty
+ // string "rwd"
+ o = append(o, 0xa3, 0x72, 0x77, 0x64)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x4000000) == 0 { // if not empty
+ // string "sdpf"
+ o = append(o, 0xa4, 0x73, 0x64, 0x70, 0x66)
+ o = (*z).unauthenticatedProposal.SeedProof.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x8000000) == 0 { // if not empty
+ // string "seed"
+ o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x10000000) == 0 { // if not empty
+ // string "spt"
+ o = append(o, 0xa3, 0x73, 0x70, 0x74)
+ if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking)))
+ }
+ zb0001_keys := make([]protocol.StateProofType, 0, len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking))
+ for zb0001 := range (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(protocol.SortStateProofType(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ o = zb0002.MarshalMsg(o)
+ }
+ }
+ if (zb0004Mask & 0x20000000) == 0 { // if not empty
+ // string "tc"
+ o = append(o, 0xa2, 0x74, 0x63)
+ o = msgp.AppendUint64(o, (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter)
+ }
+ if (zb0004Mask & 0x40000000) == 0 { // if not empty
+ // string "ts"
+ o = append(o, 0xa2, 0x74, 0x73)
+ o = msgp.AppendInt64(o, (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp)
+ }
+ if (zb0004Mask & 0x80000000) == 0 { // if not empty
+ // string "txn"
+ o = append(o, 0xa3, 0x74, 0x78, 0x6e)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x100000000) == 0 { // if not empty
+ // string "txn256"
+ o = append(o, 0xa6, 0x74, 0x78, 0x6e, 0x32, 0x35, 0x36)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x200000000) == 0 { // if not empty
+ // string "txns"
+ o = append(o, 0xa4, 0x74, 0x78, 0x6e, 0x73)
+ o = (*z).unauthenticatedProposal.Block.Payset.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x400000000) == 0 { // if not empty
+ // string "upgradedelay"
+ o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x800000000) == 0 { // if not empty
+ // string "upgradeprop"
+ o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x1000000000) == 0 { // if not empty
+ // string "upgradeyes"
+ o = append(o, 0xaa, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x79, 0x65, 0x73)
+ o = msgp.AppendBool(o, (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove)
+ }
+ }
+ return
+}
+
+func (_ *transmittedPayload) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*transmittedPayload)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *transmittedPayload) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0004 int
+ var zb0005 bool
+ zb0004, zb0005, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Branch")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Seed")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NativeSha512_256Commitment")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sha256Commitment")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "TimeStamp")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "GenesisID")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "GenesisHash")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "FeeSink")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsPool")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsLevel")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsRate")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsResidue")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsRecalculationRound")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CurrentProtocol")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocol")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocolApprovals")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocolVoteBefore")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocolSwitchOn")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UpgradePropose")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UpgradeDelay")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UpgradeApprove")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "TxnCounter")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ var zb0006 int
+ var zb0007 bool
+ zb0006, zb0007, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ return
+ }
+ if zb0006 > protocol.NumStateProofTypes {
+ err = msgp.ErrOverflow(uint64(zb0006), uint64(protocol.NumStateProofTypes))
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ return
+ }
+ if zb0007 {
+ (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = nil
+ } else if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
+ (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0006)
+ }
+ for zb0006 > 0 {
+ var zb0001 protocol.StateProofType
+ var zb0002 bookkeeping.StateProofTrackingData
+ zb0006--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking", zb0001)
+ return
+ }
+ (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking[zb0001] = zb0002
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ var zb0008 int
+ var zb0009 bool
+ zb0008, zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0008 > config.MaxProposedExpiredOnlineAccounts {
+ err = msgp.ErrOverflow(uint64(zb0008), uint64(config.MaxProposedExpiredOnlineAccounts))
+ err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0009 {
+ (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
+ } else if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0008 {
+ (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0008]
+ } else {
+ (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0008)
+ }
+ for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts", zb0003)
+ return
+ }
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.Block.Payset.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Payset")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.SeedProof.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "SeedProof")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ {
+ var zb0010 uint64
+ zb0010, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "OriginalPeriod")
+ return
+ }
+ (*z).unauthenticatedProposal.OriginalPeriod = period(zb0010)
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).unauthenticatedProposal.OriginalProposer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "OriginalProposer")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).PriorVote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "PriorVote")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0004)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0005 {
+ (*z) = transmittedPayload{}
+ }
+ for zb0004 > 0 {
+ zb0004--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "rnd":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "prev":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Branch.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Branch")
+ return
+ }
+ case "seed":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.Seed.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Seed")
+ return
+ }
+ case "txn":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NativeSha512_256Commitment")
+ return
+ }
+ case "txn256":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sha256Commitment")
+ return
+ }
+ case "ts":
+ (*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "TimeStamp")
+ return
+ }
+ case "gen":
+ (*z).unauthenticatedProposal.Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "GenesisID")
+ return
+ }
+ case "gh":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "GenesisHash")
+ return
+ }
+ case "fees":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "FeeSink")
+ return
+ }
+ case "rwd":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsPool")
+ return
+ }
+ case "earn":
+ (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsLevel")
+ return
+ }
+ case "rate":
+ (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsRate")
+ return
+ }
+ case "frac":
+ (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsResidue")
+ return
+ }
+ case "rwcalr":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsRecalculationRound")
+ return
+ }
+ case "proto":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CurrentProtocol")
+ return
+ }
+ case "nextproto":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocol")
+ return
+ }
+ case "nextyes":
+ (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocolApprovals")
+ return
+ }
+ case "nextbefore":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocolVoteBefore")
+ return
+ }
+ case "nextswitch":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocolSwitchOn")
+ return
+ }
+ case "upgradeprop":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "UpgradePropose")
+ return
+ }
+ case "upgradedelay":
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "UpgradeDelay")
+ return
+ }
+ case "upgradeyes":
+ (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "UpgradeApprove")
+ return
+ }
+ case "tc":
+ (*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "TxnCounter")
+ return
+ }
+ case "spt":
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofTracking")
+ return
+ }
+ if zb0011 > protocol.NumStateProofTypes {
+ err = msgp.ErrOverflow(uint64(zb0011), uint64(protocol.NumStateProofTypes))
+ err = msgp.WrapError(err, "StateProofTracking")
+ return
+ }
+ if zb0012 {
+ (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = nil
+ } else if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking == nil {
+ (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0011)
+ }
+ for zb0011 > 0 {
+ var zb0001 protocol.StateProofType
+ var zb0002 bookkeeping.StateProofTrackingData
+ zb0011--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofTracking")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofTracking", zb0001)
+ return
+ }
+ (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking[zb0001] = zb0002
+ }
+ case "partupdrmv":
+ var zb0013 int
+ var zb0014 bool
+ zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0013 > config.MaxProposedExpiredOnlineAccounts {
+ err = msgp.ErrOverflow(uint64(zb0013), uint64(config.MaxProposedExpiredOnlineAccounts))
+ err = msgp.WrapError(err, "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0014 {
+ (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
+ } else if (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0013 {
+ (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0013]
+ } else {
+ (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0013)
+ }
+ for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ bts, err = (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0003)
+ return
+ }
+ }
+ case "txns":
+ bts, err = (*z).unauthenticatedProposal.Block.Payset.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Payset")
+ return
+ }
+ case "sdpf":
+ bts, err = (*z).unauthenticatedProposal.SeedProof.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "SeedProof")
+ return
+ }
+ case "oper":
+ {
+ var zb0015 uint64
+ zb0015, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "OriginalPeriod")
+ return
+ }
+ (*z).unauthenticatedProposal.OriginalPeriod = period(zb0015)
+ }
+ case "oprop":
+ bts, err = (*z).unauthenticatedProposal.OriginalProposer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "OriginalProposer")
+ return
+ }
+ case "pv":
+ bts, err = (*z).PriorVote.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "PriorVote")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *transmittedPayload) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*transmittedPayload)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *transmittedPayload) Msgsize() (s int) {
+ s = 3 + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.Round.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.Branch.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.Seed.Msgsize() + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.Msgsize() + 7 + (*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.Msgsize() + 3 + msgp.Int64Size + 4 + msgp.StringPrefixSize + len((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID) + 3 + (*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.Msgsize() + 5 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.Msgsize() + 4 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.Msgsize() + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 7 + (*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.Msgsize() + 6 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.Msgsize() + 10 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.Msgsize() + 8 + msgp.Uint64Size + 11 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.Msgsize() + 11 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.Msgsize() + 12 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.Msgsize() + 13 + (*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.Msgsize() + 11 + msgp.BoolSize + 3 + msgp.Uint64Size + 4 + msgp.MapHeaderSize
+ if (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking != nil {
+ for zb0001, zb0002 := range (*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
+ }
+ }
+ s += 11 + msgp.ArrayHeaderSize
+ for zb0003 := range (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ s += (*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize()
+ }
+ s += 5 + (*z).unauthenticatedProposal.Block.Payset.Msgsize() + 5 + (*z).unauthenticatedProposal.SeedProof.Msgsize() + 5 + msgp.Uint64Size + 6 + (*z).unauthenticatedProposal.OriginalProposer.Msgsize() + 3 + (*z).PriorVote.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *transmittedPayload) MsgIsZero() bool {
+ return ((*z).unauthenticatedProposal.Block.BlockHeader.Round.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Branch.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.Seed.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.TimeStamp == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisID == "") && ((*z).unauthenticatedProposal.Block.BlockHeader.GenesisHash.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRate == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).unauthenticatedProposal.Block.BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).unauthenticatedProposal.Block.BlockHeader.TxnCounter == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.StateProofTracking) == 0) && (len((*z).unauthenticatedProposal.Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).unauthenticatedProposal.Block.Payset.MsgIsZero()) && ((*z).unauthenticatedProposal.SeedProof.MsgIsZero()) && ((*z).unauthenticatedProposal.OriginalPeriod == 0) && ((*z).unauthenticatedProposal.OriginalProposer.MsgIsZero()) && ((*z).PriorVote.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *unauthenticatedBundle) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0003Len := uint32(6)
+ var zb0003Mask uint8 /* 7 bits */
+ if len((*z).EquivocationVotes) == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x2
+ }
+ if (*z).Period == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x4
+ }
+ if (*z).Proposal.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x8
+ }
+ if (*z).Round.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x10
+ }
+ if (*z).Step == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x20
+ }
+ if len((*z).Votes) == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x40
+ }
+ // variable map header, size zb0003Len
+ o = append(o, 0x80|uint8(zb0003Len))
+ if zb0003Len != 0 {
+ if (zb0003Mask & 0x2) == 0 { // if not empty
+ // string "eqv"
+ o = append(o, 0xa3, 0x65, 0x71, 0x76)
+ if (*z).EquivocationVotes == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).EquivocationVotes)))
+ }
+ for zb0002 := range (*z).EquivocationVotes {
+ o = (*z).EquivocationVotes[zb0002].MarshalMsg(o)
+ }
+ }
+ if (zb0003Mask & 0x4) == 0 { // if not empty
+ // string "per"
+ o = append(o, 0xa3, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
+ }
+ if (zb0003Mask & 0x8) == 0 { // if not empty
+ // string "prop"
+ o = append(o, 0xa4, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).Proposal.MarshalMsg(o)
+ }
+ if (zb0003Mask & 0x10) == 0 { // if not empty
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
+ }
+ if (zb0003Mask & 0x20) == 0 { // if not empty
+ // string "step"
+ o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
+ }
+ if (zb0003Mask & 0x40) == 0 { // if not empty
+ // string "vote"
+ o = append(o, 0xa4, 0x76, 0x6f, 0x74, 0x65)
+ if (*z).Votes == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).Votes)))
+ }
+ for zb0001 := range (*z).Votes {
+ o = (*z).Votes[zb0001].MarshalMsg(o)
+ }
+ }
+ }
+ return
+}
+
+func (_ *unauthenticatedBundle) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedBundle)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *unauthenticatedBundle) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0005)
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ {
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0006)
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Votes")
+ return
+ }
+ if zb0007 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0007), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "struct-from-array", "Votes")
+ return
+ }
+ if zb0008 {
+ (*z).Votes = nil
+ } else if (*z).Votes != nil && cap((*z).Votes) >= zb0007 {
+ (*z).Votes = ((*z).Votes)[:zb0007]
+ } else {
+ (*z).Votes = make([]voteAuthenticator, zb0007)
+ }
+ for zb0001 := range (*z).Votes {
+ bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Votes", zb0001)
+ return
+ }
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0009 int
+ var zb0010 bool
+ zb0009, zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
+ return
+ }
+ if zb0009 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0009), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes")
+ return
+ }
+ if zb0010 {
+ (*z).EquivocationVotes = nil
+ } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0009 {
+ (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0009]
+ } else {
+ (*z).EquivocationVotes = make([]equivocationVoteAuthenticator, zb0009)
+ }
+ for zb0002 := range (*z).EquivocationVotes {
+ bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "EquivocationVotes", zb0002)
+ return
+ }
+ }
+ }
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 {
+ (*z) = unauthenticatedBundle{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "rnd":
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "per":
+ {
+ var zb0011 uint64
+ zb0011, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Period")
+ return
+ }
+ (*z).Period = period(zb0011)
+ }
+ case "step":
+ {
+ var zb0012 uint64
+ zb0012, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0012)
+ }
+ case "prop":
+ bts, err = (*z).Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposal")
+ return
+ }
+ case "vote":
+ var zb0013 int
+ var zb0014 bool
+ zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Votes")
+ return
+ }
+ if zb0013 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0013), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "Votes")
+ return
+ }
+ if zb0014 {
+ (*z).Votes = nil
+ } else if (*z).Votes != nil && cap((*z).Votes) >= zb0013 {
+ (*z).Votes = ((*z).Votes)[:zb0013]
+ } else {
+ (*z).Votes = make([]voteAuthenticator, zb0013)
+ }
+ for zb0001 := range (*z).Votes {
+ bts, err = (*z).Votes[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Votes", zb0001)
+ return
+ }
+ }
+ case "eqv":
+ var zb0015 int
+ var zb0016 bool
+ zb0015, zb0016, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "EquivocationVotes")
+ return
+ }
+ if zb0015 > config.MaxVoteThreshold {
+ err = msgp.ErrOverflow(uint64(zb0015), uint64(config.MaxVoteThreshold))
+ err = msgp.WrapError(err, "EquivocationVotes")
+ return
+ }
+ if zb0016 {
+ (*z).EquivocationVotes = nil
+ } else if (*z).EquivocationVotes != nil && cap((*z).EquivocationVotes) >= zb0015 {
+ (*z).EquivocationVotes = ((*z).EquivocationVotes)[:zb0015]
+ } else {
+ (*z).EquivocationVotes = make([]equivocationVoteAuthenticator, zb0015)
+ }
+ for zb0002 := range (*z).EquivocationVotes {
+ bts, err = (*z).EquivocationVotes[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "EquivocationVotes", zb0002)
+ return
+ }
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *unauthenticatedBundle) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedBundle)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *unauthenticatedBundle) Msgsize() (s int) {
+ s = 1 + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Proposal.Msgsize() + 5 + msgp.ArrayHeaderSize
+ for zb0001 := range (*z).Votes {
+ s += (*z).Votes[zb0001].Msgsize()
+ }
+ s += 4 + msgp.ArrayHeaderSize
+ for zb0002 := range (*z).EquivocationVotes {
+ s += (*z).EquivocationVotes[zb0002].Msgsize()
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *unauthenticatedBundle) MsgIsZero() bool {
+ return ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Proposal.MsgIsZero()) && (len((*z).Votes) == 0) && (len((*z).EquivocationVotes) == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *unauthenticatedEquivocationVote) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0003Len := uint32(7)
+ var zb0003Mask uint8 /* 8 bits */
+ if (*z).Cred.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x2
+ }
+ if (*z).Period == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x4
+ }
+ if ((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero()) {
+ zb0003Len--
+ zb0003Mask |= 0x8
+ }
+ if (*z).Round.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x10
+ }
+ if ((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()) {
+ zb0003Len--
+ zb0003Mask |= 0x20
+ }
+ if (*z).Sender.MsgIsZero() {
+ zb0003Len--
+ zb0003Mask |= 0x40
+ }
+ if (*z).Step == 0 {
+ zb0003Len--
+ zb0003Mask |= 0x80
+ }
+ // variable map header, size zb0003Len
+ o = append(o, 0x80|uint8(zb0003Len))
+ if zb0003Len != 0 {
+ if (zb0003Mask & 0x2) == 0 { // if not empty
+ // string "cred"
+ o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
+ o = (*z).Cred.MarshalMsg(o)
+ }
+ if (zb0003Mask & 0x4) == 0 { // if not empty
+ // string "per"
+ o = append(o, 0xa3, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).Period))
+ }
+ if (zb0003Mask & 0x8) == 0 { // if not empty
+ // string "props"
+ o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x70, 0x73)
+ o = msgp.AppendArrayHeader(o, 2)
+ for zb0001 := range (*z).Proposals {
+ o = (*z).Proposals[zb0001].MarshalMsg(o)
+ }
+ }
+ if (zb0003Mask & 0x10) == 0 { // if not empty
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).Round.MarshalMsg(o)
+ }
+ if (zb0003Mask & 0x20) == 0 { // if not empty
+ // string "sigs"
+ o = append(o, 0xa4, 0x73, 0x69, 0x67, 0x73)
+ o = msgp.AppendArrayHeader(o, 2)
+ for zb0002 := range (*z).Sigs {
+ o = (*z).Sigs[zb0002].MarshalMsg(o)
+ }
+ }
+ if (zb0003Mask & 0x40) == 0 { // if not empty
+ // string "snd"
+ o = append(o, 0xa3, 0x73, 0x6e, 0x64)
+ o = (*z).Sender.MarshalMsg(o)
+ }
+ if (zb0003Mask & 0x80) == 0 { // if not empty
+ // string "step"
+ o = append(o, 0xa4, 0x73, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
+ }
+ }
+ return
+}
+
+func (_ *unauthenticatedEquivocationVote) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedEquivocationVote)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *unauthenticatedEquivocationVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sender")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ {
+ var zb0005 uint64
+ zb0005, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Period")
+ return
+ }
+ (*z).Period = period(zb0005)
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ {
+ var zb0006 uint64
+ zb0006, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0006)
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cred")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0007 int
+ zb0007, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposals")
+ return
+ }
+ if zb0007 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0007}
+ return
+ }
+ for zb0001 := 0; zb0001 < zb0007; zb0001++ {
+ bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Proposals", zb0001)
+ return
+ }
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ var zb0008 int
+ zb0008, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sigs")
+ return
+ }
+ if zb0008 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0008}
+ return
+ }
+ for zb0002 := 0; zb0002 < zb0008; zb0002++ {
+ bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sigs", zb0002)
+ return
+ }
+ }
+ }
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 {
+ (*z) = unauthenticatedEquivocationVote{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "snd":
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sender")
+ return
+ }
+ case "rnd":
+ bts, err = (*z).Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "per":
+ {
+ var zb0009 uint64
+ zb0009, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Period")
+ return
+ }
+ (*z).Period = period(zb0009)
+ }
+ case "step":
+ {
+ var zb0010 uint64
+ zb0010, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0010)
+ }
+ case "cred":
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cred")
+ return
+ }
+ case "props":
+ var zb0011 int
+ zb0011, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposals")
+ return
+ }
+ if zb0011 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0011}
+ return
+ }
+ for zb0001 := 0; zb0001 < zb0011; zb0001++ {
+ bts, err = (*z).Proposals[zb0001].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Proposals", zb0001)
+ return
+ }
+ }
+ case "sigs":
+ var zb0012 int
+ zb0012, _, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sigs")
+ return
+ }
+ if zb0012 > 2 {
+ err = msgp.ArrayError{Wanted: 2, Got: zb0012}
+ return
+ }
+ for zb0002 := 0; zb0002 < zb0012; zb0002++ {
+ bts, err = (*z).Sigs[zb0002].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sigs", zb0002)
+ return
+ }
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *unauthenticatedEquivocationVote) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedEquivocationVote)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *unauthenticatedEquivocationVote) Msgsize() (s int) {
+ s = 1 + 4 + (*z).Sender.Msgsize() + 4 + (*z).Round.Msgsize() + 4 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + (*z).Cred.Msgsize() + 6 + msgp.ArrayHeaderSize
+ for zb0001 := range (*z).Proposals {
+ s += (*z).Proposals[zb0001].Msgsize()
+ }
+ s += 5 + msgp.ArrayHeaderSize
+ for zb0002 := range (*z).Sigs {
+ s += (*z).Sigs[zb0002].Msgsize()
+ }
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *unauthenticatedEquivocationVote) MsgIsZero() bool {
+ return ((*z).Sender.MsgIsZero()) && ((*z).Round.MsgIsZero()) && ((*z).Period == 0) && ((*z).Step == 0) && ((*z).Cred.MsgIsZero()) && (((*z).Proposals[0].MsgIsZero()) && ((*z).Proposals[1].MsgIsZero())) && (((*z).Sigs[0].MsgIsZero()) && ((*z).Sigs[1].MsgIsZero()))
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *unauthenticatedProposal) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0004Len := uint32(29)
+ var zb0004Mask uint64 /* 35 bits */
+ if (*z).Block.BlockHeader.RewardsState.RewardsLevel == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x40
+ }
+ if (*z).Block.BlockHeader.RewardsState.FeeSink.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x80
+ }
+ if (*z).Block.BlockHeader.RewardsState.RewardsResidue == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x100
+ }
+ if (*z).Block.BlockHeader.GenesisID == "" {
+ zb0004Len--
+ zb0004Mask |= 0x200
+ }
+ if (*z).Block.BlockHeader.GenesisHash.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x400
+ }
+ if (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x800
+ }
+ if (*z).Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x1000
+ }
+ if (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x2000
+ }
+ if (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x4000
+ }
+ if (*z).OriginalPeriod == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x8000
+ }
+ if (*z).OriginalProposer.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x10000
+ }
+ if len((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x20000
+ }
+ if (*z).Block.BlockHeader.Branch.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x40000
+ }
+ if (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x80000
+ }
+ if (*z).Block.BlockHeader.RewardsState.RewardsRate == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x100000
+ }
+ if (*z).Block.BlockHeader.Round.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x200000
+ }
+ if (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x400000
+ }
+ if (*z).Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x800000
+ }
+ if (*z).SeedProof.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x1000000
+ }
+ if (*z).Block.BlockHeader.Seed.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x2000000
+ }
+ if len((*z).Block.BlockHeader.StateProofTracking) == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x4000000
+ }
+ if (*z).Block.BlockHeader.TxnCounter == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x8000000
+ }
+ if (*z).Block.BlockHeader.TimeStamp == 0 {
+ zb0004Len--
+ zb0004Mask |= 0x10000000
+ }
+ if (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x20000000
+ }
+ if (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x40000000
+ }
+ if (*z).Block.Payset.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x80000000
+ }
+ if (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x100000000
+ }
+ if (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero() {
+ zb0004Len--
+ zb0004Mask |= 0x200000000
+ }
+ if (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove == false {
+ zb0004Len--
+ zb0004Mask |= 0x400000000
+ }
+ // variable map header, size zb0004Len
+ o = msgp.AppendMapHeader(o, zb0004Len)
+ if zb0004Len != 0 {
+ if (zb0004Mask & 0x40) == 0 { // if not empty
+ // string "earn"
+ o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e)
+ o = msgp.AppendUint64(o, (*z).Block.BlockHeader.RewardsState.RewardsLevel)
+ }
+ if (zb0004Mask & 0x80) == 0 { // if not empty
+ // string "fees"
+ o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73)
+ o = (*z).Block.BlockHeader.RewardsState.FeeSink.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x100) == 0 { // if not empty
+ // string "frac"
+ o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63)
+ o = msgp.AppendUint64(o, (*z).Block.BlockHeader.RewardsState.RewardsResidue)
+ }
+ if (zb0004Mask & 0x200) == 0 { // if not empty
+ // string "gen"
+ o = append(o, 0xa3, 0x67, 0x65, 0x6e)
+ o = msgp.AppendString(o, (*z).Block.BlockHeader.GenesisID)
+ }
+ if (zb0004Mask & 0x400) == 0 { // if not empty
+ // string "gh"
+ o = append(o, 0xa2, 0x67, 0x68)
+ o = (*z).Block.BlockHeader.GenesisHash.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x800) == 0 { // if not empty
+ // string "nextbefore"
+ o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65)
+ o = (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x1000) == 0 { // if not empty
+ // string "nextproto"
+ o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f)
+ o = (*z).Block.BlockHeader.UpgradeState.NextProtocol.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x2000) == 0 { // if not empty
+ // string "nextswitch"
+ o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68)
+ o = (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x4000) == 0 { // if not empty
+ // string "nextyes"
+ o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73)
+ o = msgp.AppendUint64(o, (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals)
+ }
+ if (zb0004Mask & 0x8000) == 0 { // if not empty
+ // string "oper"
+ o = append(o, 0xa4, 0x6f, 0x70, 0x65, 0x72)
+ o = msgp.AppendUint64(o, uint64((*z).OriginalPeriod))
+ }
+ if (zb0004Mask & 0x10000) == 0 { // if not empty
+ // string "oprop"
+ o = append(o, 0xa5, 0x6f, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).OriginalProposer.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x20000) == 0 { // if not empty
+ // string "partupdrmv"
+ o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76)
+ if (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendArrayHeader(o, uint32(len((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)))
+ }
+ for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ o = (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o)
+ }
+ }
+ if (zb0004Mask & 0x40000) == 0 { // if not empty
+ // string "prev"
+ o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76)
+ o = (*z).Block.BlockHeader.Branch.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x80000) == 0 { // if not empty
+ // string "proto"
+ o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f)
+ o = (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x100000) == 0 { // if not empty
+ // string "rate"
+ o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65)
+ o = msgp.AppendUint64(o, (*z).Block.BlockHeader.RewardsState.RewardsRate)
+ }
+ if (zb0004Mask & 0x200000) == 0 { // if not empty
+ // string "rnd"
+ o = append(o, 0xa3, 0x72, 0x6e, 0x64)
+ o = (*z).Block.BlockHeader.Round.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x400000) == 0 { // if not empty
+ // string "rwcalr"
+ o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72)
+ o = (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x800000) == 0 { // if not empty
+ // string "rwd"
+ o = append(o, 0xa3, 0x72, 0x77, 0x64)
+ o = (*z).Block.BlockHeader.RewardsState.RewardsPool.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x1000000) == 0 { // if not empty
+ // string "sdpf"
+ o = append(o, 0xa4, 0x73, 0x64, 0x70, 0x66)
+ o = (*z).SeedProof.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x2000000) == 0 { // if not empty
+ // string "seed"
+ o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64)
+ o = (*z).Block.BlockHeader.Seed.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x4000000) == 0 { // if not empty
+ // string "spt"
+ o = append(o, 0xa3, 0x73, 0x70, 0x74)
+ if (*z).Block.BlockHeader.StateProofTracking == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Block.BlockHeader.StateProofTracking)))
+ }
+ zb0001_keys := make([]protocol.StateProofType, 0, len((*z).Block.BlockHeader.StateProofTracking))
+ for zb0001 := range (*z).Block.BlockHeader.StateProofTracking {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(protocol.SortStateProofType(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Block.BlockHeader.StateProofTracking[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ o = zb0002.MarshalMsg(o)
+ }
+ }
+ if (zb0004Mask & 0x8000000) == 0 { // if not empty
+ // string "tc"
+ o = append(o, 0xa2, 0x74, 0x63)
+ o = msgp.AppendUint64(o, (*z).Block.BlockHeader.TxnCounter)
+ }
+ if (zb0004Mask & 0x10000000) == 0 { // if not empty
+ // string "ts"
+ o = append(o, 0xa2, 0x74, 0x73)
+ o = msgp.AppendInt64(o, (*z).Block.BlockHeader.TimeStamp)
+ }
+ if (zb0004Mask & 0x20000000) == 0 { // if not empty
+ // string "txn"
+ o = append(o, 0xa3, 0x74, 0x78, 0x6e)
+ o = (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x40000000) == 0 { // if not empty
+ // string "txn256"
+ o = append(o, 0xa6, 0x74, 0x78, 0x6e, 0x32, 0x35, 0x36)
+ o = (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x80000000) == 0 { // if not empty
+ // string "txns"
+ o = append(o, 0xa4, 0x74, 0x78, 0x6e, 0x73)
+ o = (*z).Block.Payset.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x100000000) == 0 { // if not empty
+ // string "upgradedelay"
+ o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79)
+ o = (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x200000000) == 0 { // if not empty
+ // string "upgradeprop"
+ o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70)
+ o = (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.MarshalMsg(o)
+ }
+ if (zb0004Mask & 0x400000000) == 0 { // if not empty
+ // string "upgradeyes"
+ o = append(o, 0xaa, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x79, 0x65, 0x73)
+ o = msgp.AppendBool(o, (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove)
+ }
+ }
+ return
+}
+
+func (_ *unauthenticatedProposal) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedProposal)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *unauthenticatedProposal) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0004 int
+ var zb0005 bool
+ zb0004, zb0005, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Round")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.Branch.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Branch")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.Seed.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Seed")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NativeSha512_256Commitment")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Sha256Commitment")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "TimeStamp")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "GenesisID")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "GenesisHash")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "FeeSink")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsPool")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsLevel")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsRate")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsResidue")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "RewardsRecalculationRound")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "CurrentProtocol")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocol")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocolApprovals")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocolVoteBefore")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "NextProtocolSwitchOn")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UpgradePropose")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UpgradeDelay")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "UpgradeApprove")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ (*z).Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "TxnCounter")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ var zb0006 int
+ var zb0007 bool
+ zb0006, zb0007, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ return
+ }
+ if zb0006 > protocol.NumStateProofTypes {
+ err = msgp.ErrOverflow(uint64(zb0006), uint64(protocol.NumStateProofTypes))
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ return
+ }
+ if zb0007 {
+ (*z).Block.BlockHeader.StateProofTracking = nil
+ } else if (*z).Block.BlockHeader.StateProofTracking == nil {
+ (*z).Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0006)
+ }
+ for zb0006 > 0 {
+ var zb0001 protocol.StateProofType
+ var zb0002 bookkeeping.StateProofTrackingData
+ zb0006--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofTracking", zb0001)
+ return
+ }
+ (*z).Block.BlockHeader.StateProofTracking[zb0001] = zb0002
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ var zb0008 int
+ var zb0009 bool
+ zb0008, zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0008 > config.MaxProposedExpiredOnlineAccounts {
+ err = msgp.ErrOverflow(uint64(zb0008), uint64(config.MaxProposedExpiredOnlineAccounts))
+ err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0009 {
+ (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
+ } else if (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0008 {
+ (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0008]
+ } else {
+ (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0008)
+ }
+ for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ bts, err = (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts", zb0003)
+ return
+ }
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).Block.Payset.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Payset")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).SeedProof.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "SeedProof")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ {
+ var zb0010 uint64
+ zb0010, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "OriginalPeriod")
+ return
+ }
+ (*z).OriginalPeriod = period(zb0010)
+ }
+ }
+ if zb0004 > 0 {
+ zb0004--
+ bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "OriginalProposer")
+ return
+ }
+ }
+ if zb0004 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0004)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0005 {
+ (*z) = unauthenticatedProposal{}
+ }
+ for zb0004 > 0 {
+ zb0004--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "rnd":
+ bts, err = (*z).Block.BlockHeader.Round.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Round")
+ return
+ }
+ case "prev":
+ bts, err = (*z).Block.BlockHeader.Branch.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Branch")
+ return
+ }
+ case "seed":
+ bts, err = (*z).Block.BlockHeader.Seed.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Seed")
+ return
+ }
+ case "txn":
+ bts, err = (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NativeSha512_256Commitment")
+ return
+ }
+ case "txn256":
+ bts, err = (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sha256Commitment")
+ return
+ }
+ case "ts":
+ (*z).Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "TimeStamp")
+ return
+ }
+ case "gen":
+ (*z).Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "GenesisID")
+ return
+ }
+ case "gh":
+ bts, err = (*z).Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "GenesisHash")
+ return
+ }
+ case "fees":
+ bts, err = (*z).Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "FeeSink")
+ return
+ }
+ case "rwd":
+ bts, err = (*z).Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsPool")
+ return
+ }
+ case "earn":
+ (*z).Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsLevel")
+ return
+ }
+ case "rate":
+ (*z).Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsRate")
+ return
+ }
+ case "frac":
+ (*z).Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsResidue")
+ return
+ }
+ case "rwcalr":
+ bts, err = (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "RewardsRecalculationRound")
+ return
+ }
+ case "proto":
+ bts, err = (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "CurrentProtocol")
+ return
+ }
+ case "nextproto":
+ bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocol")
+ return
+ }
+ case "nextyes":
+ (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocolApprovals")
+ return
+ }
+ case "nextbefore":
+ bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocolVoteBefore")
+ return
+ }
+ case "nextswitch":
+ bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "NextProtocolSwitchOn")
+ return
+ }
+ case "upgradeprop":
+ bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "UpgradePropose")
+ return
+ }
+ case "upgradedelay":
+ bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "UpgradeDelay")
+ return
+ }
+ case "upgradeyes":
+ (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "UpgradeApprove")
+ return
+ }
+ case "tc":
+ (*z).Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "TxnCounter")
+ return
+ }
+ case "spt":
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofTracking")
+ return
+ }
+ if zb0011 > protocol.NumStateProofTypes {
+ err = msgp.ErrOverflow(uint64(zb0011), uint64(protocol.NumStateProofTypes))
+ err = msgp.WrapError(err, "StateProofTracking")
+ return
+ }
+ if zb0012 {
+ (*z).Block.BlockHeader.StateProofTracking = nil
+ } else if (*z).Block.BlockHeader.StateProofTracking == nil {
+ (*z).Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0011)
+ }
+ for zb0011 > 0 {
+ var zb0001 protocol.StateProofType
+ var zb0002 bookkeeping.StateProofTrackingData
+ zb0011--
+ bts, err = zb0001.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofTracking")
+ return
+ }
+ bts, err = zb0002.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofTracking", zb0001)
+ return
+ }
+ (*z).Block.BlockHeader.StateProofTracking[zb0001] = zb0002
+ }
+ case "partupdrmv":
+ var zb0013 int
+ var zb0014 bool
+ zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0013 > config.MaxProposedExpiredOnlineAccounts {
+ err = msgp.ErrOverflow(uint64(zb0013), uint64(config.MaxProposedExpiredOnlineAccounts))
+ err = msgp.WrapError(err, "ExpiredParticipationAccounts")
+ return
+ }
+ if zb0014 {
+ (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
+ } else if (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0013 {
+ (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0013]
+ } else {
+ (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0013)
+ }
+ for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ bts, err = (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0003)
+ return
+ }
+ }
+ case "txns":
+ bts, err = (*z).Block.Payset.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Payset")
+ return
+ }
+ case "sdpf":
+ bts, err = (*z).SeedProof.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "SeedProof")
+ return
+ }
+ case "oper":
+ {
+ var zb0015 uint64
+ zb0015, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "OriginalPeriod")
+ return
+ }
+ (*z).OriginalPeriod = period(zb0015)
+ }
+ case "oprop":
+ bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "OriginalProposer")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
}
}
- if (zb0004Mask & 0x8000000) == 0 { // if not empty
- // string "tc"
- o = append(o, 0xa2, 0x74, 0x63)
- o = msgp.AppendUint64(o, (*z).Block.BlockHeader.TxnCounter)
- }
- if (zb0004Mask & 0x10000000) == 0 { // if not empty
- // string "ts"
- o = append(o, 0xa2, 0x74, 0x73)
- o = msgp.AppendInt64(o, (*z).Block.BlockHeader.TimeStamp)
- }
- if (zb0004Mask & 0x20000000) == 0 { // if not empty
- // string "txn"
- o = append(o, 0xa3, 0x74, 0x78, 0x6e)
- o = (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MarshalMsg(o)
- }
- if (zb0004Mask & 0x40000000) == 0 { // if not empty
- // string "txn256"
- o = append(o, 0xa6, 0x74, 0x78, 0x6e, 0x32, 0x35, 0x36)
- o = (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.MarshalMsg(o)
- }
- if (zb0004Mask & 0x80000000) == 0 { // if not empty
- // string "txns"
- o = append(o, 0xa4, 0x74, 0x78, 0x6e, 0x73)
- o = (*z).Block.Payset.MarshalMsg(o)
+ }
+ o = bts
+ return
+}
+
+func (_ *unauthenticatedProposal) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedProposal)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *unauthenticatedProposal) Msgsize() (s int) {
+ s = 3 + 4 + (*z).Block.BlockHeader.Round.Msgsize() + 5 + (*z).Block.BlockHeader.Branch.Msgsize() + 5 + (*z).Block.BlockHeader.Seed.Msgsize() + 4 + (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.Msgsize() + 7 + (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.Msgsize() + 3 + msgp.Int64Size + 4 + msgp.StringPrefixSize + len((*z).Block.BlockHeader.GenesisID) + 3 + (*z).Block.BlockHeader.GenesisHash.Msgsize() + 5 + (*z).Block.BlockHeader.RewardsState.FeeSink.Msgsize() + 4 + (*z).Block.BlockHeader.RewardsState.RewardsPool.Msgsize() + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 7 + (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.Msgsize() + 6 + (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.Msgsize() + 10 + (*z).Block.BlockHeader.UpgradeState.NextProtocol.Msgsize() + 8 + msgp.Uint64Size + 11 + (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.Msgsize() + 11 + (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.Msgsize() + 12 + (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.Msgsize() + 13 + (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.Msgsize() + 11 + msgp.BoolSize + 3 + msgp.Uint64Size + 4 + msgp.MapHeaderSize
+ if (*z).Block.BlockHeader.StateProofTracking != nil {
+ for zb0001, zb0002 := range (*z).Block.BlockHeader.StateProofTracking {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
}
- if (zb0004Mask & 0x100000000) == 0 { // if not empty
- // string "upgradedelay"
- o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79)
- o = (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.MarshalMsg(o)
+ }
+ s += 11 + msgp.ArrayHeaderSize
+ for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
+ s += (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize()
+ }
+ s += 5 + (*z).Block.Payset.Msgsize() + 5 + (*z).SeedProof.Msgsize() + 5 + msgp.Uint64Size + 6 + (*z).OriginalProposer.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *unauthenticatedProposal) MsgIsZero() bool {
+ return ((*z).Block.BlockHeader.Round.MsgIsZero()) && ((*z).Block.BlockHeader.Branch.MsgIsZero()) && ((*z).Block.BlockHeader.Seed.MsgIsZero()) && ((*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero()) && ((*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero()) && ((*z).Block.BlockHeader.TimeStamp == 0) && ((*z).Block.BlockHeader.GenesisID == "") && ((*z).Block.BlockHeader.GenesisHash.MsgIsZero()) && ((*z).Block.BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).Block.BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).Block.BlockHeader.RewardsState.RewardsRate == 0) && ((*z).Block.BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).Block.BlockHeader.TxnCounter == 0) && (len((*z).Block.BlockHeader.StateProofTracking) == 0) && (len((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).Block.Payset.MsgIsZero()) && ((*z).SeedProof.MsgIsZero()) && ((*z).OriginalPeriod == 0) && ((*z).OriginalProposer.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *unauthenticatedVote) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0001Len := uint32(3)
+ var zb0001Mask uint8 /* 4 bits */
+ if (*z).Cred.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x2
+ }
+ if (*z).R.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x4
+ }
+ if (*z).Sig.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x8
+ }
+ // variable map header, size zb0001Len
+ o = append(o, 0x80|uint8(zb0001Len))
+ if zb0001Len != 0 {
+ if (zb0001Mask & 0x2) == 0 { // if not empty
+ // string "cred"
+ o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
+ o = (*z).Cred.MarshalMsg(o)
}
- if (zb0004Mask & 0x200000000) == 0 { // if not empty
- // string "upgradeprop"
- o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70)
- o = (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.MarshalMsg(o)
+ if (zb0001Mask & 0x4) == 0 { // if not empty
+ // string "r"
+ o = append(o, 0xa1, 0x72)
+ o = (*z).R.MarshalMsg(o)
}
- if (zb0004Mask & 0x400000000) == 0 { // if not empty
- // string "upgradeyes"
- o = append(o, 0xaa, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x79, 0x65, 0x73)
- o = msgp.AppendBool(o, (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove)
+ if (zb0001Mask & 0x8) == 0 { // if not empty
+ // string "sig"
+ o = append(o, 0xa3, 0x73, 0x69, 0x67)
+ o = (*z).Sig.MarshalMsg(o)
}
}
return
}
-func (_ *unauthenticatedProposal) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedProposal)
+func (_ *unauthenticatedVote) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedVote)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *unauthenticatedProposal) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *unauthenticatedVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
- var zb0004 int
- var zb0005 bool
- zb0004, zb0005, bts, err = msgp.ReadMapHeaderBytes(bts)
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
if _, ok := err.(msgp.TypeError); ok {
- zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.Round.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Round")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.Branch.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Branch")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.Seed.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Seed")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NativeSha512_256Commitment")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sha256Commitment")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "TimeStamp")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "GenesisID")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "GenesisHash")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "FeeSink")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsPool")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsLevel")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsRate")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsResidue")
- return
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).R.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "RewardsRecalculationRound")
+ err = msgp.WrapError(err, "struct-from-array", "R")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "CurrentProtocol")
+ err = msgp.WrapError(err, "struct-from-array", "Cred")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Sig.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocol")
+ err = msgp.WrapError(err, "struct-from-array", "Sig")
return
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocolApprovals")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = unauthenticatedVote{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocolVoteBefore")
+ err = msgp.WrapError(err)
return
}
+ switch string(field) {
+ case "r":
+ bts, err = (*z).R.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "R")
+ return
+ }
+ case "cred":
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cred")
+ return
+ }
+ case "sig":
+ bts, err = (*z).Sig.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sig")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ }
+ o = bts
+ return
+}
+
+func (_ *unauthenticatedVote) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*unauthenticatedVote)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *unauthenticatedVote) Msgsize() (s int) {
+ s = 1 + 2 + (*z).R.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + (*z).Sig.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *unauthenticatedVote) MsgIsZero() bool {
+ return ((*z).R.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && ((*z).Sig.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *vote) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0001Len := uint32(3)
+ var zb0001Mask uint8 /* 4 bits */
+ if (*z).Cred.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x2
+ }
+ if (*z).R.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x4
+ }
+ if (*z).Sig.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x8
+ }
+ // variable map header, size zb0001Len
+ o = append(o, 0x80|uint8(zb0001Len))
+ if zb0001Len != 0 {
+ if (zb0001Mask & 0x2) == 0 { // if not empty
+ // string "cred"
+ o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
+ o = (*z).Cred.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x4) == 0 { // if not empty
+ // string "r"
+ o = append(o, 0xa1, 0x72)
+ o = (*z).R.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x8) == 0 { // if not empty
+ // string "sig"
+ o = append(o, 0xa3, 0x73, 0x69, 0x67)
+ o = (*z).Sig.MarshalMsg(o)
+ }
+ }
+ return
+}
+
+func (_ *vote) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*vote)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *vote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).R.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "NextProtocolSwitchOn")
+ err = msgp.WrapError(err, "struct-from-array", "R")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "UpgradePropose")
+ err = msgp.WrapError(err, "struct-from-array", "Cred")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Sig.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "UpgradeDelay")
+ err = msgp.WrapError(err, "struct-from-array", "Sig")
return
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "UpgradeApprove")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
}
- if zb0004 > 0 {
- zb0004--
- (*z).Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = vote{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "TxnCounter")
+ err = msgp.WrapError(err)
return
}
+ switch string(field) {
+ case "r":
+ bts, err = (*z).R.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "R")
+ return
+ }
+ case "cred":
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cred")
+ return
+ }
+ case "sig":
+ bts, err = (*z).Sig.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Sig")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
}
- if zb0004 > 0 {
- zb0004--
- var zb0006 int
- var zb0007 bool
- zb0006, zb0007, bts, err = msgp.ReadMapHeaderBytes(bts)
+ }
+ o = bts
+ return
+}
+
+func (_ *vote) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*vote)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *vote) Msgsize() (s int) {
+ s = 1 + 2 + (*z).R.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + (*z).Sig.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *vote) MsgIsZero() bool {
+ return ((*z).R.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && ((*z).Sig.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *voteAggregator) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 0
+ o = append(o, 0x80)
+ return
+}
+
+func (_ *voteAggregator) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteAggregator)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *voteAggregator) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
- return
- }
- if zb0006 > protocol.NumStateProofTypes {
- err = msgp.ErrOverflow(uint64(zb0006), uint64(protocol.NumStateProofTypes))
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
+ err = msgp.WrapError(err, "struct-from-array")
return
}
- if zb0007 {
- (*z).Block.BlockHeader.StateProofTracking = nil
- } else if (*z).Block.BlockHeader.StateProofTracking == nil {
- (*z).Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0006)
- }
- for zb0006 > 0 {
- var zb0001 protocol.StateProofType
- var zb0002 bookkeeping.StateProofTrackingData
- zb0006--
- bts, err = zb0001.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking")
- return
- }
- bts, err = zb0002.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofTracking", zb0001)
- return
- }
- (*z).Block.BlockHeader.StateProofTracking[zb0001] = zb0002
- }
}
- if zb0004 > 0 {
- zb0004--
- var zb0008 int
- var zb0009 bool
- zb0008, zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = voteAggregator{}
+ }
+ for zb0001 > 0 {
+ zb0001--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
- return
- }
- if zb0008 > config.MaxProposedExpiredOnlineAccounts {
- err = msgp.ErrOverflow(uint64(zb0008), uint64(config.MaxProposedExpiredOnlineAccounts))
- err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts")
+ err = msgp.WrapError(err)
return
}
- if zb0009 {
- (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
- } else if (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0008 {
- (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0008]
- } else {
- (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0008)
- }
- for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- bts, err = (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ switch string(field) {
+ default:
+ err = msgp.ErrNoField(string(field))
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts", zb0003)
+ err = msgp.WrapError(err)
return
}
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).Block.Payset.UnmarshalMsg(bts)
+ }
+ o = bts
+ return
+}
+
+func (_ *voteAggregator) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteAggregator)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *voteAggregator) Msgsize() (s int) {
+ s = 1
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *voteAggregator) MsgIsZero() bool {
+ return true
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *voteAuthenticator) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0001Len := uint32(3)
+ var zb0001Mask uint8 /* 4 bits */
+ if (*z).Sig.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x4
+ }
+ // variable map header, size zb0001Len
+ o = append(o, 0x80|uint8(zb0001Len))
+ if zb0001Len != 0 {
+ // string "cred"
+ o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
+ o = (*z).Cred.MarshalMsg(o)
+ if (zb0001Mask & 0x4) == 0 { // if not empty
+ // string "sig"
+ o = append(o, 0xa3, 0x73, 0x69, 0x67)
+ o = (*z).Sig.MarshalMsg(o)
+ }
+ // string "snd"
+ o = append(o, 0xa3, 0x73, 0x6e, 0x64)
+ o = (*z).Sender.MarshalMsg(o)
+ }
+ return
+}
+
+func (_ *voteAuthenticator) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteAuthenticator)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *voteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Payset")
+ err = msgp.WrapError(err, "struct-from-array", "Sender")
return
}
}
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).SeedProof.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "SeedProof")
+ err = msgp.WrapError(err, "struct-from-array", "Cred")
return
}
}
- if zb0004 > 0 {
- zb0004--
- {
- var zb0010 uint64
- zb0010, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "OriginalPeriod")
- return
- }
- (*z).OriginalPeriod = period(zb0010)
- }
- }
- if zb0004 > 0 {
- zb0004--
- bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).Sig.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "OriginalProposer")
+ err = msgp.WrapError(err, "struct-from-array", "Sig")
return
}
}
- if zb0004 > 0 {
- err = msgp.ErrTooManyArrayFields(zb0004)
+ if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
err = msgp.WrapError(err, "struct-from-array")
return
@@ -5301,332 +10764,439 @@ func (z *unauthenticatedProposal) UnmarshalMsg(bts []byte) (o []byte, err error)
err = msgp.WrapError(err)
return
}
- if zb0005 {
- (*z) = unauthenticatedProposal{}
+ if zb0002 {
+ (*z) = voteAuthenticator{}
}
- for zb0004 > 0 {
- zb0004--
+ for zb0001 > 0 {
+ zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch string(field) {
- case "rnd":
- bts, err = (*z).Block.BlockHeader.Round.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Round")
- return
- }
- case "prev":
- bts, err = (*z).Block.BlockHeader.Branch.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Branch")
- return
- }
- case "seed":
- bts, err = (*z).Block.BlockHeader.Seed.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Seed")
- return
- }
- case "txn":
- bts, err = (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "NativeSha512_256Commitment")
- return
- }
- case "txn256":
- bts, err = (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sha256Commitment")
- return
- }
- case "ts":
- (*z).Block.BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "TimeStamp")
- return
- }
- case "gen":
- (*z).Block.BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "GenesisID")
- return
- }
- case "gh":
- bts, err = (*z).Block.BlockHeader.GenesisHash.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "GenesisHash")
- return
- }
- case "fees":
- bts, err = (*z).Block.BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "FeeSink")
- return
- }
- case "rwd":
- bts, err = (*z).Block.BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsPool")
- return
- }
- case "earn":
- (*z).Block.BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsLevel")
- return
- }
- case "rate":
- (*z).Block.BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsRate")
- return
- }
- case "frac":
- (*z).Block.BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts)
- if err != nil {
- err = msgp.WrapError(err, "RewardsResidue")
- return
- }
- case "rwcalr":
- bts, err = (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts)
+ case "snd":
+ bts, err = (*z).Sender.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "RewardsRecalculationRound")
+ err = msgp.WrapError(err, "Sender")
return
}
- case "proto":
- bts, err = (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts)
+ case "cred":
+ bts, err = (*z).Cred.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "CurrentProtocol")
+ err = msgp.WrapError(err, "Cred")
return
}
- case "nextproto":
- bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts)
+ case "sig":
+ bts, err = (*z).Sig.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "NextProtocol")
+ err = msgp.WrapError(err, "Sig")
return
}
- case "nextyes":
- (*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts)
+ default:
+ err = msgp.ErrNoField(string(field))
if err != nil {
- err = msgp.WrapError(err, "NextProtocolApprovals")
+ err = msgp.WrapError(err)
return
}
- case "nextbefore":
- bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts)
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *voteAuthenticator) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteAuthenticator)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *voteAuthenticator) Msgsize() (s int) {
+ s = 1 + 4 + (*z).Sender.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + (*z).Sig.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *voteAuthenticator) MsgIsZero() bool {
+ return ((*z).Sender.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && ((*z).Sig.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *voteTracker) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 4
+ // string "Counts"
+ o = append(o, 0x84, 0xa6, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73)
+ if (*z).Counts == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Counts)))
+ }
+ zb0003_keys := make([]proposalValue, 0, len((*z).Counts))
+ for zb0003 := range (*z).Counts {
+ zb0003_keys = append(zb0003_keys, zb0003)
+ }
+ sort.Sort(SortProposalValue(zb0003_keys))
+ for _, zb0003 := range zb0003_keys {
+ zb0004 := (*z).Counts[zb0003]
+ _ = zb0004
+ o = zb0003.MarshalMsg(o)
+ o = zb0004.MarshalMsg(o)
+ }
+ // string "Equivocators"
+ o = append(o, 0xac, 0x45, 0x71, 0x75, 0x69, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73)
+ if (*z).Equivocators == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Equivocators)))
+ }
+ zb0005_keys := make([]basics.Address, 0, len((*z).Equivocators))
+ for zb0005 := range (*z).Equivocators {
+ zb0005_keys = append(zb0005_keys, zb0005)
+ }
+ sort.Sort(SortAddress(zb0005_keys))
+ for _, zb0005 := range zb0005_keys {
+ zb0006 := (*z).Equivocators[zb0005]
+ _ = zb0006
+ o = zb0005.MarshalMsg(o)
+ o = zb0006.MarshalMsg(o)
+ }
+ // string "EquivocatorsCount"
+ o = append(o, 0xb1, 0x45, 0x71, 0x75, 0x69, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74)
+ o = msgp.AppendUint64(o, (*z).EquivocatorsCount)
+ // string "Voters"
+ o = append(o, 0xa6, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x73)
+ if (*z).Voters == nil {
+ o = msgp.AppendNil(o)
+ } else {
+ o = msgp.AppendMapHeader(o, uint32(len((*z).Voters)))
+ }
+ zb0001_keys := make([]basics.Address, 0, len((*z).Voters))
+ for zb0001 := range (*z).Voters {
+ zb0001_keys = append(zb0001_keys, zb0001)
+ }
+ sort.Sort(SortAddress(zb0001_keys))
+ for _, zb0001 := range zb0001_keys {
+ zb0002 := (*z).Voters[zb0001]
+ _ = zb0002
+ o = zb0001.MarshalMsg(o)
+ o = zb0002.MarshalMsg(o)
+ }
+ return
+}
+
+func (_ *voteTracker) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTracker)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *voteTracker) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0007 int
+ var zb0008 bool
+ zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0007, zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0007 > 0 {
+ zb0007--
+ var zb0009 int
+ var zb0010 bool
+ zb0009, zb0010, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Voters")
+ return
+ }
+ if zb0010 {
+ (*z).Voters = nil
+ } else if (*z).Voters == nil {
+ (*z).Voters = make(map[basics.Address]vote, zb0009)
+ }
+ for zb0009 > 0 {
+ var zb0001 basics.Address
+ var zb0002 vote
+ zb0009--
+ bts, err = zb0001.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "NextProtocolVoteBefore")
+ err = msgp.WrapError(err, "struct-from-array", "Voters")
return
}
- case "nextswitch":
- bts, err = (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts)
+ bts, err = zb0002.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "NextProtocolSwitchOn")
+ err = msgp.WrapError(err, "struct-from-array", "Voters", zb0001)
return
}
- case "upgradeprop":
- bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts)
+ (*z).Voters[zb0001] = zb0002
+ }
+ }
+ if zb0007 > 0 {
+ zb0007--
+ var zb0011 int
+ var zb0012 bool
+ zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Counts")
+ return
+ }
+ if zb0012 {
+ (*z).Counts = nil
+ } else if (*z).Counts == nil {
+ (*z).Counts = make(map[proposalValue]proposalVoteCounter, zb0011)
+ }
+ for zb0011 > 0 {
+ var zb0003 proposalValue
+ var zb0004 proposalVoteCounter
+ zb0011--
+ bts, err = zb0003.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "UpgradePropose")
+ err = msgp.WrapError(err, "struct-from-array", "Counts")
return
}
- case "upgradedelay":
- bts, err = (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts)
+ bts, err = zb0004.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "UpgradeDelay")
+ err = msgp.WrapError(err, "struct-from-array", "Counts", zb0003)
return
}
- case "upgradeyes":
- (*z).Block.BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts)
+ (*z).Counts[zb0003] = zb0004
+ }
+ }
+ if zb0007 > 0 {
+ zb0007--
+ var zb0013 int
+ var zb0014 bool
+ zb0013, zb0014, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Equivocators")
+ return
+ }
+ if zb0014 {
+ (*z).Equivocators = nil
+ } else if (*z).Equivocators == nil {
+ (*z).Equivocators = make(map[basics.Address]equivocationVote, zb0013)
+ }
+ for zb0013 > 0 {
+ var zb0005 basics.Address
+ var zb0006 equivocationVote
+ zb0013--
+ bts, err = zb0005.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "UpgradeApprove")
+ err = msgp.WrapError(err, "struct-from-array", "Equivocators")
return
}
- case "tc":
- (*z).Block.BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts)
+ bts, err = zb0006.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "TxnCounter")
+ err = msgp.WrapError(err, "struct-from-array", "Equivocators", zb0005)
return
}
- case "spt":
- var zb0011 int
- var zb0012 bool
- zb0011, zb0012, bts, err = msgp.ReadMapHeaderBytes(bts)
+ (*z).Equivocators[zb0005] = zb0006
+ }
+ }
+ if zb0007 > 0 {
+ zb0007--
+ (*z).EquivocatorsCount, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "EquivocatorsCount")
+ return
+ }
+ }
+ if zb0007 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0007)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0008 {
+ (*z) = voteTracker{}
+ }
+ for zb0007 > 0 {
+ zb0007--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ switch string(field) {
+ case "Voters":
+ var zb0015 int
+ var zb0016 bool
+ zb0015, zb0016, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "StateProofTracking")
- return
- }
- if zb0011 > protocol.NumStateProofTypes {
- err = msgp.ErrOverflow(uint64(zb0011), uint64(protocol.NumStateProofTypes))
- err = msgp.WrapError(err, "StateProofTracking")
+ err = msgp.WrapError(err, "Voters")
return
}
- if zb0012 {
- (*z).Block.BlockHeader.StateProofTracking = nil
- } else if (*z).Block.BlockHeader.StateProofTracking == nil {
- (*z).Block.BlockHeader.StateProofTracking = make(map[protocol.StateProofType]bookkeeping.StateProofTrackingData, zb0011)
- }
- for zb0011 > 0 {
- var zb0001 protocol.StateProofType
- var zb0002 bookkeeping.StateProofTrackingData
- zb0011--
+ if zb0016 {
+ (*z).Voters = nil
+ } else if (*z).Voters == nil {
+ (*z).Voters = make(map[basics.Address]vote, zb0015)
+ }
+ for zb0015 > 0 {
+ var zb0001 basics.Address
+ var zb0002 vote
+ zb0015--
bts, err = zb0001.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "StateProofTracking")
+ err = msgp.WrapError(err, "Voters")
return
}
bts, err = zb0002.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "StateProofTracking", zb0001)
+ err = msgp.WrapError(err, "Voters", zb0001)
return
}
- (*z).Block.BlockHeader.StateProofTracking[zb0001] = zb0002
+ (*z).Voters[zb0001] = zb0002
}
- case "partupdrmv":
- var zb0013 int
- var zb0014 bool
- zb0013, zb0014, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ case "Counts":
+ var zb0017 int
+ var zb0018 bool
+ zb0017, zb0018, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "ExpiredParticipationAccounts")
- return
- }
- if zb0013 > config.MaxProposedExpiredOnlineAccounts {
- err = msgp.ErrOverflow(uint64(zb0013), uint64(config.MaxProposedExpiredOnlineAccounts))
- err = msgp.WrapError(err, "ExpiredParticipationAccounts")
+ err = msgp.WrapError(err, "Counts")
return
}
- if zb0014 {
- (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil
- } else if (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0013 {
- (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0013]
- } else {
- (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0013)
+ if zb0018 {
+ (*z).Counts = nil
+ } else if (*z).Counts == nil {
+ (*z).Counts = make(map[proposalValue]proposalVoteCounter, zb0017)
}
- for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- bts, err = (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts)
+ for zb0017 > 0 {
+ var zb0003 proposalValue
+ var zb0004 proposalVoteCounter
+ zb0017--
+ bts, err = zb0003.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0003)
+ err = msgp.WrapError(err, "Counts")
+ return
+ }
+ bts, err = zb0004.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Counts", zb0003)
return
}
+ (*z).Counts[zb0003] = zb0004
}
- case "txns":
- bts, err = (*z).Block.Payset.UnmarshalMsg(bts)
+ case "Equivocators":
+ var zb0019 int
+ var zb0020 bool
+ zb0019, zb0020, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Payset")
+ err = msgp.WrapError(err, "Equivocators")
return
}
- case "sdpf":
- bts, err = (*z).SeedProof.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "SeedProof")
- return
+ if zb0020 {
+ (*z).Equivocators = nil
+ } else if (*z).Equivocators == nil {
+ (*z).Equivocators = make(map[basics.Address]equivocationVote, zb0019)
}
- case "oper":
- {
- var zb0015 uint64
- zb0015, bts, err = msgp.ReadUint64Bytes(bts)
+ for zb0019 > 0 {
+ var zb0005 basics.Address
+ var zb0006 equivocationVote
+ zb0019--
+ bts, err = zb0005.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "OriginalPeriod")
+ err = msgp.WrapError(err, "Equivocators")
return
}
- (*z).OriginalPeriod = period(zb0015)
+ bts, err = zb0006.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Equivocators", zb0005)
+ return
+ }
+ (*z).Equivocators[zb0005] = zb0006
}
- case "oprop":
- bts, err = (*z).OriginalProposer.UnmarshalMsg(bts)
+ case "EquivocatorsCount":
+ (*z).EquivocatorsCount, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
- err = msgp.WrapError(err, "OriginalProposer")
+ err = msgp.WrapError(err, "EquivocatorsCount")
return
}
default:
err = msgp.ErrNoField(string(field))
if err != nil {
err = msgp.WrapError(err)
- return
- }
- }
- }
- }
- o = bts
- return
-}
-
-func (_ *unauthenticatedProposal) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedProposal)
- return ok
-}
-
-// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *unauthenticatedProposal) Msgsize() (s int) {
- s = 3 + 4 + (*z).Block.BlockHeader.Round.Msgsize() + 5 + (*z).Block.BlockHeader.Branch.Msgsize() + 5 + (*z).Block.BlockHeader.Seed.Msgsize() + 4 + (*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.Msgsize() + 7 + (*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.Msgsize() + 3 + msgp.Int64Size + 4 + msgp.StringPrefixSize + len((*z).Block.BlockHeader.GenesisID) + 3 + (*z).Block.BlockHeader.GenesisHash.Msgsize() + 5 + (*z).Block.BlockHeader.RewardsState.FeeSink.Msgsize() + 4 + (*z).Block.BlockHeader.RewardsState.RewardsPool.Msgsize() + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 7 + (*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.Msgsize() + 6 + (*z).Block.BlockHeader.UpgradeState.CurrentProtocol.Msgsize() + 10 + (*z).Block.BlockHeader.UpgradeState.NextProtocol.Msgsize() + 8 + msgp.Uint64Size + 11 + (*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.Msgsize() + 11 + (*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.Msgsize() + 12 + (*z).Block.BlockHeader.UpgradeVote.UpgradePropose.Msgsize() + 13 + (*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.Msgsize() + 11 + msgp.BoolSize + 3 + msgp.Uint64Size + 4 + msgp.MapHeaderSize
- if (*z).Block.BlockHeader.StateProofTracking != nil {
- for zb0001, zb0002 := range (*z).Block.BlockHeader.StateProofTracking {
- _ = zb0001
- _ = zb0002
- s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
- }
- }
- s += 11 + msgp.ArrayHeaderSize
- for zb0003 := range (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts {
- s += (*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize()
- }
- s += 5 + (*z).Block.Payset.Msgsize() + 5 + (*z).SeedProof.Msgsize() + 5 + msgp.Uint64Size + 6 + (*z).OriginalProposer.Msgsize()
- return
-}
-
-// MsgIsZero returns whether this is a zero value
-func (z *unauthenticatedProposal) MsgIsZero() bool {
- return ((*z).Block.BlockHeader.Round.MsgIsZero()) && ((*z).Block.BlockHeader.Branch.MsgIsZero()) && ((*z).Block.BlockHeader.Seed.MsgIsZero()) && ((*z).Block.BlockHeader.TxnCommitments.NativeSha512_256Commitment.MsgIsZero()) && ((*z).Block.BlockHeader.TxnCommitments.Sha256Commitment.MsgIsZero()) && ((*z).Block.BlockHeader.TimeStamp == 0) && ((*z).Block.BlockHeader.GenesisID == "") && ((*z).Block.BlockHeader.GenesisHash.MsgIsZero()) && ((*z).Block.BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).Block.BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).Block.BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).Block.BlockHeader.RewardsState.RewardsRate == 0) && ((*z).Block.BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).Block.BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).Block.BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).Block.BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).Block.BlockHeader.TxnCounter == 0) && (len((*z).Block.BlockHeader.StateProofTracking) == 0) && (len((*z).Block.BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).Block.Payset.MsgIsZero()) && ((*z).SeedProof.MsgIsZero()) && ((*z).OriginalPeriod == 0) && ((*z).OriginalProposer.MsgIsZero())
-}
-
-// MarshalMsg implements msgp.Marshaler
-func (z *unauthenticatedVote) MarshalMsg(b []byte) (o []byte) {
- o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0001Len := uint32(3)
- var zb0001Mask uint8 /* 4 bits */
- if (*z).Cred.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x2
- }
- if (*z).R.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x4
- }
- if (*z).Sig.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x8
- }
- // variable map header, size zb0001Len
- o = append(o, 0x80|uint8(zb0001Len))
- if zb0001Len != 0 {
- if (zb0001Mask & 0x2) == 0 { // if not empty
- // string "cred"
- o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
- o = (*z).Cred.MarshalMsg(o)
+ return
+ }
+ }
}
- if (zb0001Mask & 0x4) == 0 { // if not empty
- // string "r"
- o = append(o, 0xa1, 0x72)
- o = (*z).R.MarshalMsg(o)
+ }
+ o = bts
+ return
+}
+
+func (_ *voteTracker) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTracker)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *voteTracker) Msgsize() (s int) {
+ s = 1 + 7 + msgp.MapHeaderSize
+ if (*z).Voters != nil {
+ for zb0001, zb0002 := range (*z).Voters {
+ _ = zb0001
+ _ = zb0002
+ s += 0 + zb0001.Msgsize() + zb0002.Msgsize()
}
- if (zb0001Mask & 0x8) == 0 { // if not empty
- // string "sig"
- o = append(o, 0xa3, 0x73, 0x69, 0x67)
- o = (*z).Sig.MarshalMsg(o)
+ }
+ s += 7 + msgp.MapHeaderSize
+ if (*z).Counts != nil {
+ for zb0003, zb0004 := range (*z).Counts {
+ _ = zb0003
+ _ = zb0004
+ s += 0 + zb0003.Msgsize() + zb0004.Msgsize()
}
}
+ s += 13 + msgp.MapHeaderSize
+ if (*z).Equivocators != nil {
+ for zb0005, zb0006 := range (*z).Equivocators {
+ _ = zb0005
+ _ = zb0006
+ s += 0 + zb0005.Msgsize() + zb0006.Msgsize()
+ }
+ }
+ s += 18 + msgp.Uint64Size
return
}
-func (_ *unauthenticatedVote) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedVote)
+// MsgIsZero returns whether this is a zero value
+func (z *voteTracker) MsgIsZero() bool {
+ return (len((*z).Voters) == 0) && (len((*z).Counts) == 0) && (len((*z).Equivocators) == 0) && ((*z).EquivocatorsCount == 0)
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *voteTrackerContract) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // map header, size 3
+ // string "Emitted"
+ o = append(o, 0x83, 0xa7, 0x45, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64)
+ o = msgp.AppendBool(o, (*z).Emitted)
+ // string "Step"
+ o = append(o, 0xa4, 0x53, 0x74, 0x65, 0x70)
+ o = msgp.AppendUint64(o, uint64((*z).Step))
+ // string "StepOk"
+ o = append(o, 0xa6, 0x53, 0x74, 0x65, 0x70, 0x4f, 0x6b)
+ o = msgp.AppendBool(o, (*z).StepOk)
+ return
+}
+
+func (_ *voteTrackerContract) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTrackerContract)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *unauthenticatedVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *voteTrackerContract) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -5640,25 +11210,29 @@ func (z *unauthenticatedVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).R.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "R")
- return
+ {
+ var zb0003 uint64
+ zb0003, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Step")
+ return
+ }
+ (*z).Step = step(zb0003)
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ (*z).StepOk, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Cred")
+ err = msgp.WrapError(err, "struct-from-array", "StepOk")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Sig.UnmarshalMsg(bts)
+ (*z).Emitted, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sig")
+ err = msgp.WrapError(err, "struct-from-array", "Emitted")
return
}
}
@@ -5675,7 +11249,7 @@ func (z *unauthenticatedVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = unauthenticatedVote{}
+ (*z) = voteTrackerContract{}
}
for zb0001 > 0 {
zb0001--
@@ -5685,22 +11259,26 @@ func (z *unauthenticatedVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "r":
- bts, err = (*z).R.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "R")
- return
+ case "Step":
+ {
+ var zb0004 uint64
+ zb0004, bts, err = msgp.ReadUint64Bytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Step")
+ return
+ }
+ (*z).Step = step(zb0004)
}
- case "cred":
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ case "StepOk":
+ (*z).StepOk, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Cred")
+ err = msgp.WrapError(err, "StepOk")
return
}
- case "sig":
- bts, err = (*z).Sig.UnmarshalMsg(bts)
+ case "Emitted":
+ (*z).Emitted, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Sig")
+ err = msgp.WrapError(err, "Emitted")
return
}
default:
@@ -5716,69 +11294,45 @@ func (z *unauthenticatedVote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *unauthenticatedVote) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*unauthenticatedVote)
+func (_ *voteTrackerContract) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTrackerContract)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *unauthenticatedVote) Msgsize() (s int) {
- s = 1 + 2 + (*z).R.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + (*z).Sig.Msgsize()
+func (z *voteTrackerContract) Msgsize() (s int) {
+ s = 1 + 5 + msgp.Uint64Size + 7 + msgp.BoolSize + 8 + msgp.BoolSize
return
}
// MsgIsZero returns whether this is a zero value
-func (z *unauthenticatedVote) MsgIsZero() bool {
- return ((*z).R.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && ((*z).Sig.MsgIsZero())
+func (z *voteTrackerContract) MsgIsZero() bool {
+ return ((*z).Step == 0) && ((*z).StepOk == false) && ((*z).Emitted == false)
}
// MarshalMsg implements msgp.Marshaler
-func (z *vote) MarshalMsg(b []byte) (o []byte) {
+func (z *voteTrackerPeriod) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0001Len := uint32(3)
- var zb0001Mask uint8 /* 4 bits */
- if (*z).Cred.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x2
- }
- if (*z).R.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x4
- }
- if (*z).Sig.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x8
- }
- // variable map header, size zb0001Len
- o = append(o, 0x80|uint8(zb0001Len))
- if zb0001Len != 0 {
- if (zb0001Mask & 0x2) == 0 { // if not empty
- // string "cred"
- o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
- o = (*z).Cred.MarshalMsg(o)
- }
- if (zb0001Mask & 0x4) == 0 { // if not empty
- // string "r"
- o = append(o, 0xa1, 0x72)
- o = (*z).R.MarshalMsg(o)
- }
- if (zb0001Mask & 0x8) == 0 { // if not empty
- // string "sig"
- o = append(o, 0xa3, 0x73, 0x69, 0x67)
- o = (*z).Sig.MarshalMsg(o)
- }
- }
+ // map header, size 1
+ // string "Cached"
+ o = append(o, 0x81, 0xa6, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64)
+ // map header, size 2
+ // string "Bottom"
+ o = append(o, 0x82, 0xa6, 0x42, 0x6f, 0x74, 0x74, 0x6f, 0x6d)
+ o = msgp.AppendBool(o, (*z).Cached.Bottom)
+ // string "Proposal"
+ o = append(o, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c)
+ o = (*z).Cached.Proposal.MarshalMsg(o)
return
}
-func (_ *vote) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*vote)
+func (_ *voteTrackerPeriod) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTrackerPeriod)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *vote) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *voteTrackerPeriod) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -5792,26 +11346,74 @@ func (z *vote) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).R.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "R")
- return
- }
- }
- if zb0001 > 0 {
- zb0001--
- bts, err = (*z).Cred.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Cred")
- return
- }
- }
- if zb0001 > 0 {
- zb0001--
- bts, err = (*z).Sig.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sig")
- return
+ var zb0003 int
+ var zb0004 bool
+ zb0003, zb0004, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached")
+ return
+ }
+ if zb0003 > 0 {
+ zb0003--
+ (*z).Cached.Bottom, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached", "struct-from-array", "Bottom")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ zb0003--
+ bts, err = (*z).Cached.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached", "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0003 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0003)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached")
+ return
+ }
+ if zb0004 {
+ (*z).Cached = nextThresholdStatusEvent{}
+ }
+ for zb0003 > 0 {
+ zb0003--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached")
+ return
+ }
+ switch string(field) {
+ case "Bottom":
+ (*z).Cached.Bottom, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached", "Bottom")
+ return
+ }
+ case "Proposal":
+ bts, err = (*z).Cached.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached", "Proposal")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "Cached")
+ return
+ }
+ }
+ }
}
}
if zb0001 > 0 {
@@ -5827,7 +11429,7 @@ func (z *vote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = vote{}
+ (*z) = voteTrackerPeriod{}
}
for zb0001 > 0 {
zb0001--
@@ -5837,23 +11439,75 @@ func (z *vote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "r":
- bts, err = (*z).R.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "R")
- return
- }
- case "cred":
- bts, err = (*z).Cred.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Cred")
- return
- }
- case "sig":
- bts, err = (*z).Sig.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Sig")
- return
+ case "Cached":
+ var zb0005 int
+ var zb0006 bool
+ zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0005, zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached")
+ return
+ }
+ if zb0005 > 0 {
+ zb0005--
+ (*z).Cached.Bottom, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached", "struct-from-array", "Bottom")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ zb0005--
+ bts, err = (*z).Cached.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached", "struct-from-array", "Proposal")
+ return
+ }
+ }
+ if zb0005 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0005)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached", "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err, "Cached")
+ return
+ }
+ if zb0006 {
+ (*z).Cached = nextThresholdStatusEvent{}
+ }
+ for zb0005 > 0 {
+ zb0005--
+ field, bts, err = msgp.ReadMapKeyZC(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached")
+ return
+ }
+ switch string(field) {
+ case "Bottom":
+ (*z).Cached.Bottom, bts, err = msgp.ReadBoolBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached", "Bottom")
+ return
+ }
+ case "Proposal":
+ bts, err = (*z).Cached.Proposal.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "Cached", "Proposal")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err, "Cached")
+ return
+ }
+ }
+ }
}
default:
err = msgp.ErrNoField(string(field))
@@ -5868,57 +11522,42 @@ func (z *vote) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *vote) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*vote)
+func (_ *voteTrackerPeriod) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTrackerPeriod)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *vote) Msgsize() (s int) {
- s = 1 + 2 + (*z).R.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + (*z).Sig.Msgsize()
+func (z *voteTrackerPeriod) Msgsize() (s int) {
+ s = 1 + 7 + 1 + 7 + msgp.BoolSize + 9 + (*z).Cached.Proposal.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z *vote) MsgIsZero() bool {
- return ((*z).R.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && ((*z).Sig.MsgIsZero())
+func (z *voteTrackerPeriod) MsgIsZero() bool {
+ return (((*z).Cached.Bottom == false) && ((*z).Cached.Proposal.MsgIsZero()))
}
// MarshalMsg implements msgp.Marshaler
-func (z *voteAuthenticator) MarshalMsg(b []byte) (o []byte) {
+func (z *voteTrackerRound) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
- // omitempty: check for empty values
- zb0001Len := uint32(3)
- var zb0001Mask uint8 /* 4 bits */
- if (*z).Sig.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x4
- }
- // variable map header, size zb0001Len
- o = append(o, 0x80|uint8(zb0001Len))
- if zb0001Len != 0 {
- // string "cred"
- o = append(o, 0xa4, 0x63, 0x72, 0x65, 0x64)
- o = (*z).Cred.MarshalMsg(o)
- if (zb0001Mask & 0x4) == 0 { // if not empty
- // string "sig"
- o = append(o, 0xa3, 0x73, 0x69, 0x67)
- o = (*z).Sig.MarshalMsg(o)
- }
- // string "snd"
- o = append(o, 0xa3, 0x73, 0x6e, 0x64)
- o = (*z).Sender.MarshalMsg(o)
- }
+ // map header, size 2
+ // string "Freshest"
+ o = append(o, 0x82, 0xa8, 0x46, 0x72, 0x65, 0x73, 0x68, 0x65, 0x73, 0x74)
+ o = (*z).Freshest.MarshalMsg(o)
+ // string "Ok"
+ o = append(o, 0xa2, 0x4f, 0x6b)
+ o = msgp.AppendBool(o, (*z).Ok)
return
}
-func (_ *voteAuthenticator) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*voteAuthenticator)
+func (_ *voteTrackerRound) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTrackerRound)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *voteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *voteTrackerRound) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -5932,25 +11571,17 @@ func (z *voteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Sender.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sender")
- return
- }
- }
- if zb0001 > 0 {
- zb0001--
- bts, err = (*z).Cred.UnmarshalMsg(bts)
+ bts, err = (*z).Freshest.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Cred")
+ err = msgp.WrapError(err, "struct-from-array", "Freshest")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).Sig.UnmarshalMsg(bts)
+ (*z).Ok, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "Sig")
+ err = msgp.WrapError(err, "struct-from-array", "Ok")
return
}
}
@@ -5967,7 +11598,7 @@ func (z *voteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = voteAuthenticator{}
+ (*z) = voteTrackerRound{}
}
for zb0001 > 0 {
zb0001--
@@ -5977,22 +11608,16 @@ func (z *voteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
switch string(field) {
- case "snd":
- bts, err = (*z).Sender.UnmarshalMsg(bts)
+ case "Freshest":
+ bts, err = (*z).Freshest.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "Sender")
- return
- }
- case "cred":
- bts, err = (*z).Cred.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "Cred")
+ err = msgp.WrapError(err, "Freshest")
return
}
- case "sig":
- bts, err = (*z).Sig.UnmarshalMsg(bts)
+ case "Ok":
+ (*z).Ok, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
- err = msgp.WrapError(err, "Sig")
+ err = msgp.WrapError(err, "Ok")
return
}
default:
@@ -6008,18 +11633,18 @@ func (z *voteAuthenticator) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *voteAuthenticator) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*voteAuthenticator)
+func (_ *voteTrackerRound) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*voteTrackerRound)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *voteAuthenticator) Msgsize() (s int) {
- s = 1 + 4 + (*z).Sender.Msgsize() + 5 + (*z).Cred.Msgsize() + 4 + (*z).Sig.Msgsize()
+func (z *voteTrackerRound) Msgsize() (s int) {
+ s = 1 + 9 + (*z).Freshest.Msgsize() + 3 + msgp.BoolSize
return
}
// MsgIsZero returns whether this is a zero value
-func (z *voteAuthenticator) MsgIsZero() bool {
- return ((*z).Sender.MsgIsZero()) && ((*z).Cred.MsgIsZero()) && ((*z).Sig.MsgIsZero())
+func (z *voteTrackerRound) MsgIsZero() bool {
+ return ((*z).Freshest.MsgIsZero()) && ((*z).Ok == false)
}
diff --git a/agreement/msgp_gen_test.go b/agreement/msgp_gen_test.go
index 0231cc28ad..99053ca4c3 100644
--- a/agreement/msgp_gen_test.go
+++ b/agreement/msgp_gen_test.go
@@ -74,9 +74,1569 @@ func BenchmarkUnmarshalCertificate(b *testing.B) {
}
}
+func TestMarshalUnmarshalConsensusVersionView(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := ConsensusVersionView{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingConsensusVersionView(t *testing.T) {
+ protocol.RunEncodingTest(t, &ConsensusVersionView{})
+}
+
+func BenchmarkMarshalMsgConsensusVersionView(b *testing.B) {
+ v := ConsensusVersionView{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgConsensusVersionView(b *testing.B) {
+ v := ConsensusVersionView{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalConsensusVersionView(b *testing.B) {
+ v := ConsensusVersionView{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalblockAssembler(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := blockAssembler{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingblockAssembler(t *testing.T) {
+ protocol.RunEncodingTest(t, &blockAssembler{})
+}
+
+func BenchmarkMarshalMsgblockAssembler(b *testing.B) {
+ v := blockAssembler{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgblockAssembler(b *testing.B) {
+ v := blockAssembler{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalblockAssembler(b *testing.B) {
+ v := blockAssembler{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
func TestMarshalUnmarshalbundle(t *testing.T) {
partitiontest.PartitionTest(t)
- v := bundle{}
+ v := bundle{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingbundle(t *testing.T) {
+ protocol.RunEncodingTest(t, &bundle{})
+}
+
+func BenchmarkMarshalMsgbundle(b *testing.B) {
+ v := bundle{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgbundle(b *testing.B) {
+ v := bundle{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalbundle(b *testing.B) {
+ v := bundle{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalcompoundMessage(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := compoundMessage{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingcompoundMessage(t *testing.T) {
+ protocol.RunEncodingTest(t, &compoundMessage{})
+}
+
+func BenchmarkMarshalMsgcompoundMessage(b *testing.B) {
+ v := compoundMessage{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgcompoundMessage(b *testing.B) {
+ v := compoundMessage{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalcompoundMessage(b *testing.B) {
+ v := compoundMessage{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshaldiskState(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := diskState{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingdiskState(t *testing.T) {
+ protocol.RunEncodingTest(t, &diskState{})
+}
+
+func BenchmarkMarshalMsgdiskState(b *testing.B) {
+ v := diskState{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgdiskState(b *testing.B) {
+ v := diskState{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshaldiskState(b *testing.B) {
+ v := diskState{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalequivocationVote(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := equivocationVote{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingequivocationVote(t *testing.T) {
+ protocol.RunEncodingTest(t, &equivocationVote{})
+}
+
+func BenchmarkMarshalMsgequivocationVote(b *testing.B) {
+ v := equivocationVote{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgequivocationVote(b *testing.B) {
+ v := equivocationVote{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalequivocationVote(b *testing.B) {
+ v := equivocationVote{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalequivocationVoteAuthenticator(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := equivocationVoteAuthenticator{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingequivocationVoteAuthenticator(t *testing.T) {
+ protocol.RunEncodingTest(t, &equivocationVoteAuthenticator{})
+}
+
+func BenchmarkMarshalMsgequivocationVoteAuthenticator(b *testing.B) {
+ v := equivocationVoteAuthenticator{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgequivocationVoteAuthenticator(b *testing.B) {
+ v := equivocationVoteAuthenticator{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalequivocationVoteAuthenticator(b *testing.B) {
+ v := equivocationVoteAuthenticator{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalfreshnessData(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := freshnessData{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingfreshnessData(t *testing.T) {
+ protocol.RunEncodingTest(t, &freshnessData{})
+}
+
+func BenchmarkMarshalMsgfreshnessData(b *testing.B) {
+ v := freshnessData{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgfreshnessData(b *testing.B) {
+ v := freshnessData{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalfreshnessData(b *testing.B) {
+ v := freshnessData{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalmessage(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := message{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingmessage(t *testing.T) {
+ protocol.RunEncodingTest(t, &message{})
+}
+
+func BenchmarkMarshalMsgmessage(b *testing.B) {
+ v := message{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgmessage(b *testing.B) {
+ v := message{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalmessage(b *testing.B) {
+ v := message{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalmessageEvent(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := messageEvent{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingmessageEvent(t *testing.T) {
+ protocol.RunEncodingTest(t, &messageEvent{})
+}
+
+func BenchmarkMarshalMsgmessageEvent(b *testing.B) {
+ v := messageEvent{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgmessageEvent(b *testing.B) {
+ v := messageEvent{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalmessageEvent(b *testing.B) {
+ v := messageEvent{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalnextThresholdStatusEvent(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := nextThresholdStatusEvent{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingnextThresholdStatusEvent(t *testing.T) {
+ protocol.RunEncodingTest(t, &nextThresholdStatusEvent{})
+}
+
+func BenchmarkMarshalMsgnextThresholdStatusEvent(b *testing.B) {
+ v := nextThresholdStatusEvent{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgnextThresholdStatusEvent(b *testing.B) {
+ v := nextThresholdStatusEvent{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalnextThresholdStatusEvent(b *testing.B) {
+ v := nextThresholdStatusEvent{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalperiodRouter(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := periodRouter{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingperiodRouter(t *testing.T) {
+ protocol.RunEncodingTest(t, &periodRouter{})
+}
+
+func BenchmarkMarshalMsgperiodRouter(b *testing.B) {
+ v := periodRouter{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgperiodRouter(b *testing.B) {
+ v := periodRouter{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalperiodRouter(b *testing.B) {
+ v := periodRouter{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalplayer(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := player{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingplayer(t *testing.T) {
+ protocol.RunEncodingTest(t, &player{})
+}
+
+func BenchmarkMarshalMsgplayer(b *testing.B) {
+ v := player{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgplayer(b *testing.B) {
+ v := player{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalplayer(b *testing.B) {
+ v := player{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposal(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposal{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposal(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposal{})
+}
+
+func BenchmarkMarshalMsgproposal(b *testing.B) {
+ v := proposal{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposal(b *testing.B) {
+ v := proposal{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposal(b *testing.B) {
+ v := proposal{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalManager(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalManager{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalManager(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalManager{})
+}
+
+func BenchmarkMarshalMsgproposalManager(b *testing.B) {
+ v := proposalManager{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalManager(b *testing.B) {
+ v := proposalManager{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalManager(b *testing.B) {
+ v := proposalManager{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalSeeker(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalSeeker{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalSeeker(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalSeeker{})
+}
+
+func BenchmarkMarshalMsgproposalSeeker(b *testing.B) {
+ v := proposalSeeker{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalSeeker(b *testing.B) {
+ v := proposalSeeker{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalSeeker(b *testing.B) {
+ v := proposalSeeker{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalStore(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalStore{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalStore(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalStore{})
+}
+
+func BenchmarkMarshalMsgproposalStore(b *testing.B) {
+ v := proposalStore{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalStore(b *testing.B) {
+ v := proposalStore{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalStore(b *testing.B) {
+ v := proposalStore{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalTable(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalTable{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalTable(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalTable{})
+}
+
+func BenchmarkMarshalMsgproposalTable(b *testing.B) {
+ v := proposalTable{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalTable(b *testing.B) {
+ v := proposalTable{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalTable(b *testing.B) {
+ v := proposalTable{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalTracker(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalTracker{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalTracker(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalTracker{})
+}
+
+func BenchmarkMarshalMsgproposalTracker(b *testing.B) {
+ v := proposalTracker{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalTracker(b *testing.B) {
+ v := proposalTracker{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalTracker(b *testing.B) {
+ v := proposalTracker{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalTrackerContract(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalTrackerContract{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalTrackerContract(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalTrackerContract{})
+}
+
+func BenchmarkMarshalMsgproposalTrackerContract(b *testing.B) {
+ v := proposalTrackerContract{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalTrackerContract(b *testing.B) {
+ v := proposalTrackerContract{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalTrackerContract(b *testing.B) {
+ v := proposalTrackerContract{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalValue(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalValue{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalValue(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalValue{})
+}
+
+func BenchmarkMarshalMsgproposalValue(b *testing.B) {
+ v := proposalValue{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalValue(b *testing.B) {
+ v := proposalValue{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalValue(b *testing.B) {
+ v := proposalValue{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposalVoteCounter(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposalVoteCounter{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposalVoteCounter(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposalVoteCounter{})
+}
+
+func BenchmarkMarshalMsgproposalVoteCounter(b *testing.B) {
+ v := proposalVoteCounter{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposalVoteCounter(b *testing.B) {
+ v := proposalVoteCounter{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposalVoteCounter(b *testing.B) {
+ v := proposalVoteCounter{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalproposerSeed(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := proposerSeed{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingproposerSeed(t *testing.T) {
+ protocol.RunEncodingTest(t, &proposerSeed{})
+}
+
+func BenchmarkMarshalMsgproposerSeed(b *testing.B) {
+ v := proposerSeed{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgproposerSeed(b *testing.B) {
+ v := proposerSeed{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalproposerSeed(b *testing.B) {
+ v := proposerSeed{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalrawVote(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := rawVote{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingrawVote(t *testing.T) {
+ protocol.RunEncodingTest(t, &rawVote{})
+}
+
+func BenchmarkMarshalMsgrawVote(b *testing.B) {
+ v := rawVote{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgrawVote(b *testing.B) {
+ v := rawVote{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalrawVote(b *testing.B) {
+ v := rawVote{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalrootRouter(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := rootRouter{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingrootRouter(t *testing.T) {
+ protocol.RunEncodingTest(t, &rootRouter{})
+}
+
+func BenchmarkMarshalMsgrootRouter(b *testing.B) {
+ v := rootRouter{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgrootRouter(b *testing.B) {
+ v := rootRouter{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalrootRouter(b *testing.B) {
+ v := rootRouter{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalroundRouter(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := roundRouter{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingroundRouter(t *testing.T) {
+ protocol.RunEncodingTest(t, &roundRouter{})
+}
+
+func BenchmarkMarshalMsgroundRouter(b *testing.B) {
+ v := roundRouter{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgroundRouter(b *testing.B) {
+ v := roundRouter{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalroundRouter(b *testing.B) {
+ v := roundRouter{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalseedInput(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := seedInput{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -95,12 +1655,12 @@ func TestMarshalUnmarshalbundle(t *testing.T) {
}
}
-func TestRandomizedEncodingbundle(t *testing.T) {
- protocol.RunEncodingTest(t, &bundle{})
+func TestRandomizedEncodingseedInput(t *testing.T) {
+ protocol.RunEncodingTest(t, &seedInput{})
}
-func BenchmarkMarshalMsgbundle(b *testing.B) {
- v := bundle{}
+func BenchmarkMarshalMsgseedInput(b *testing.B) {
+ v := seedInput{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -108,8 +1668,8 @@ func BenchmarkMarshalMsgbundle(b *testing.B) {
}
}
-func BenchmarkAppendMsgbundle(b *testing.B) {
- v := bundle{}
+func BenchmarkAppendMsgseedInput(b *testing.B) {
+ v := seedInput{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -120,8 +1680,8 @@ func BenchmarkAppendMsgbundle(b *testing.B) {
}
}
-func BenchmarkUnmarshalbundle(b *testing.B) {
- v := bundle{}
+func BenchmarkUnmarshalseedInput(b *testing.B) {
+ v := seedInput{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -134,9 +1694,9 @@ func BenchmarkUnmarshalbundle(b *testing.B) {
}
}
-func TestMarshalUnmarshalequivocationVote(t *testing.T) {
+func TestMarshalUnmarshalselector(t *testing.T) {
partitiontest.PartitionTest(t)
- v := equivocationVote{}
+ v := selector{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -155,12 +1715,12 @@ func TestMarshalUnmarshalequivocationVote(t *testing.T) {
}
}
-func TestRandomizedEncodingequivocationVote(t *testing.T) {
- protocol.RunEncodingTest(t, &equivocationVote{})
+func TestRandomizedEncodingselector(t *testing.T) {
+ protocol.RunEncodingTest(t, &selector{})
}
-func BenchmarkMarshalMsgequivocationVote(b *testing.B) {
- v := equivocationVote{}
+func BenchmarkMarshalMsgselector(b *testing.B) {
+ v := selector{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -168,8 +1728,8 @@ func BenchmarkMarshalMsgequivocationVote(b *testing.B) {
}
}
-func BenchmarkAppendMsgequivocationVote(b *testing.B) {
- v := equivocationVote{}
+func BenchmarkAppendMsgselector(b *testing.B) {
+ v := selector{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -180,8 +1740,8 @@ func BenchmarkAppendMsgequivocationVote(b *testing.B) {
}
}
-func BenchmarkUnmarshalequivocationVote(b *testing.B) {
- v := equivocationVote{}
+func BenchmarkUnmarshalselector(b *testing.B) {
+ v := selector{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -194,9 +1754,9 @@ func BenchmarkUnmarshalequivocationVote(b *testing.B) {
}
}
-func TestMarshalUnmarshalequivocationVoteAuthenticator(t *testing.T) {
+func TestMarshalUnmarshalstepRouter(t *testing.T) {
partitiontest.PartitionTest(t)
- v := equivocationVoteAuthenticator{}
+ v := stepRouter{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -215,12 +1775,12 @@ func TestMarshalUnmarshalequivocationVoteAuthenticator(t *testing.T) {
}
}
-func TestRandomizedEncodingequivocationVoteAuthenticator(t *testing.T) {
- protocol.RunEncodingTest(t, &equivocationVoteAuthenticator{})
+func TestRandomizedEncodingstepRouter(t *testing.T) {
+ protocol.RunEncodingTest(t, &stepRouter{})
}
-func BenchmarkMarshalMsgequivocationVoteAuthenticator(b *testing.B) {
- v := equivocationVoteAuthenticator{}
+func BenchmarkMarshalMsgstepRouter(b *testing.B) {
+ v := stepRouter{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -228,8 +1788,8 @@ func BenchmarkMarshalMsgequivocationVoteAuthenticator(b *testing.B) {
}
}
-func BenchmarkAppendMsgequivocationVoteAuthenticator(b *testing.B) {
- v := equivocationVoteAuthenticator{}
+func BenchmarkAppendMsgstepRouter(b *testing.B) {
+ v := stepRouter{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -240,8 +1800,8 @@ func BenchmarkAppendMsgequivocationVoteAuthenticator(b *testing.B) {
}
}
-func BenchmarkUnmarshalequivocationVoteAuthenticator(b *testing.B) {
- v := equivocationVoteAuthenticator{}
+func BenchmarkUnmarshalstepRouter(b *testing.B) {
+ v := stepRouter{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -254,9 +1814,9 @@ func BenchmarkUnmarshalequivocationVoteAuthenticator(b *testing.B) {
}
}
-func TestMarshalUnmarshalproposal(t *testing.T) {
+func TestMarshalUnmarshalthresholdEvent(t *testing.T) {
partitiontest.PartitionTest(t)
- v := proposal{}
+ v := thresholdEvent{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -275,12 +1835,12 @@ func TestMarshalUnmarshalproposal(t *testing.T) {
}
}
-func TestRandomizedEncodingproposal(t *testing.T) {
- protocol.RunEncodingTest(t, &proposal{})
+func TestRandomizedEncodingthresholdEvent(t *testing.T) {
+ protocol.RunEncodingTest(t, &thresholdEvent{})
}
-func BenchmarkMarshalMsgproposal(b *testing.B) {
- v := proposal{}
+func BenchmarkMarshalMsgthresholdEvent(b *testing.B) {
+ v := thresholdEvent{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -288,8 +1848,8 @@ func BenchmarkMarshalMsgproposal(b *testing.B) {
}
}
-func BenchmarkAppendMsgproposal(b *testing.B) {
- v := proposal{}
+func BenchmarkAppendMsgthresholdEvent(b *testing.B) {
+ v := thresholdEvent{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -300,8 +1860,8 @@ func BenchmarkAppendMsgproposal(b *testing.B) {
}
}
-func BenchmarkUnmarshalproposal(b *testing.B) {
- v := proposal{}
+func BenchmarkUnmarshalthresholdEvent(b *testing.B) {
+ v := thresholdEvent{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -314,9 +1874,9 @@ func BenchmarkUnmarshalproposal(b *testing.B) {
}
}
-func TestMarshalUnmarshalproposalValue(t *testing.T) {
+func TestMarshalUnmarshaltransmittedPayload(t *testing.T) {
partitiontest.PartitionTest(t)
- v := proposalValue{}
+ v := transmittedPayload{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -335,12 +1895,12 @@ func TestMarshalUnmarshalproposalValue(t *testing.T) {
}
}
-func TestRandomizedEncodingproposalValue(t *testing.T) {
- protocol.RunEncodingTest(t, &proposalValue{})
+func TestRandomizedEncodingtransmittedPayload(t *testing.T) {
+ protocol.RunEncodingTest(t, &transmittedPayload{})
}
-func BenchmarkMarshalMsgproposalValue(b *testing.B) {
- v := proposalValue{}
+func BenchmarkMarshalMsgtransmittedPayload(b *testing.B) {
+ v := transmittedPayload{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -348,8 +1908,8 @@ func BenchmarkMarshalMsgproposalValue(b *testing.B) {
}
}
-func BenchmarkAppendMsgproposalValue(b *testing.B) {
- v := proposalValue{}
+func BenchmarkAppendMsgtransmittedPayload(b *testing.B) {
+ v := transmittedPayload{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -360,8 +1920,8 @@ func BenchmarkAppendMsgproposalValue(b *testing.B) {
}
}
-func BenchmarkUnmarshalproposalValue(b *testing.B) {
- v := proposalValue{}
+func BenchmarkUnmarshaltransmittedPayload(b *testing.B) {
+ v := transmittedPayload{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -374,9 +1934,9 @@ func BenchmarkUnmarshalproposalValue(b *testing.B) {
}
}
-func TestMarshalUnmarshalproposerSeed(t *testing.T) {
+func TestMarshalUnmarshalunauthenticatedBundle(t *testing.T) {
partitiontest.PartitionTest(t)
- v := proposerSeed{}
+ v := unauthenticatedBundle{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -395,12 +1955,12 @@ func TestMarshalUnmarshalproposerSeed(t *testing.T) {
}
}
-func TestRandomizedEncodingproposerSeed(t *testing.T) {
- protocol.RunEncodingTest(t, &proposerSeed{})
+func TestRandomizedEncodingunauthenticatedBundle(t *testing.T) {
+ protocol.RunEncodingTest(t, &unauthenticatedBundle{})
}
-func BenchmarkMarshalMsgproposerSeed(b *testing.B) {
- v := proposerSeed{}
+func BenchmarkMarshalMsgunauthenticatedBundle(b *testing.B) {
+ v := unauthenticatedBundle{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -408,8 +1968,8 @@ func BenchmarkMarshalMsgproposerSeed(b *testing.B) {
}
}
-func BenchmarkAppendMsgproposerSeed(b *testing.B) {
- v := proposerSeed{}
+func BenchmarkAppendMsgunauthenticatedBundle(b *testing.B) {
+ v := unauthenticatedBundle{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -420,8 +1980,8 @@ func BenchmarkAppendMsgproposerSeed(b *testing.B) {
}
}
-func BenchmarkUnmarshalproposerSeed(b *testing.B) {
- v := proposerSeed{}
+func BenchmarkUnmarshalunauthenticatedBundle(b *testing.B) {
+ v := unauthenticatedBundle{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -434,9 +1994,9 @@ func BenchmarkUnmarshalproposerSeed(b *testing.B) {
}
}
-func TestMarshalUnmarshalrawVote(t *testing.T) {
+func TestMarshalUnmarshalunauthenticatedEquivocationVote(t *testing.T) {
partitiontest.PartitionTest(t)
- v := rawVote{}
+ v := unauthenticatedEquivocationVote{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -455,12 +2015,12 @@ func TestMarshalUnmarshalrawVote(t *testing.T) {
}
}
-func TestRandomizedEncodingrawVote(t *testing.T) {
- protocol.RunEncodingTest(t, &rawVote{})
+func TestRandomizedEncodingunauthenticatedEquivocationVote(t *testing.T) {
+ protocol.RunEncodingTest(t, &unauthenticatedEquivocationVote{})
}
-func BenchmarkMarshalMsgrawVote(b *testing.B) {
- v := rawVote{}
+func BenchmarkMarshalMsgunauthenticatedEquivocationVote(b *testing.B) {
+ v := unauthenticatedEquivocationVote{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -468,8 +2028,8 @@ func BenchmarkMarshalMsgrawVote(b *testing.B) {
}
}
-func BenchmarkAppendMsgrawVote(b *testing.B) {
- v := rawVote{}
+func BenchmarkAppendMsgunauthenticatedEquivocationVote(b *testing.B) {
+ v := unauthenticatedEquivocationVote{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -480,8 +2040,8 @@ func BenchmarkAppendMsgrawVote(b *testing.B) {
}
}
-func BenchmarkUnmarshalrawVote(b *testing.B) {
- v := rawVote{}
+func BenchmarkUnmarshalunauthenticatedEquivocationVote(b *testing.B) {
+ v := unauthenticatedEquivocationVote{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -494,9 +2054,9 @@ func BenchmarkUnmarshalrawVote(b *testing.B) {
}
}
-func TestMarshalUnmarshalseedInput(t *testing.T) {
+func TestMarshalUnmarshalunauthenticatedProposal(t *testing.T) {
partitiontest.PartitionTest(t)
- v := seedInput{}
+ v := unauthenticatedProposal{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -515,12 +2075,12 @@ func TestMarshalUnmarshalseedInput(t *testing.T) {
}
}
-func TestRandomizedEncodingseedInput(t *testing.T) {
- protocol.RunEncodingTest(t, &seedInput{})
+func TestRandomizedEncodingunauthenticatedProposal(t *testing.T) {
+ protocol.RunEncodingTest(t, &unauthenticatedProposal{})
}
-func BenchmarkMarshalMsgseedInput(b *testing.B) {
- v := seedInput{}
+func BenchmarkMarshalMsgunauthenticatedProposal(b *testing.B) {
+ v := unauthenticatedProposal{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -528,8 +2088,8 @@ func BenchmarkMarshalMsgseedInput(b *testing.B) {
}
}
-func BenchmarkAppendMsgseedInput(b *testing.B) {
- v := seedInput{}
+func BenchmarkAppendMsgunauthenticatedProposal(b *testing.B) {
+ v := unauthenticatedProposal{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -540,8 +2100,8 @@ func BenchmarkAppendMsgseedInput(b *testing.B) {
}
}
-func BenchmarkUnmarshalseedInput(b *testing.B) {
- v := seedInput{}
+func BenchmarkUnmarshalunauthenticatedProposal(b *testing.B) {
+ v := unauthenticatedProposal{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -554,9 +2114,9 @@ func BenchmarkUnmarshalseedInput(b *testing.B) {
}
}
-func TestMarshalUnmarshalselector(t *testing.T) {
+func TestMarshalUnmarshalunauthenticatedVote(t *testing.T) {
partitiontest.PartitionTest(t)
- v := selector{}
+ v := unauthenticatedVote{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -575,12 +2135,12 @@ func TestMarshalUnmarshalselector(t *testing.T) {
}
}
-func TestRandomizedEncodingselector(t *testing.T) {
- protocol.RunEncodingTest(t, &selector{})
+func TestRandomizedEncodingunauthenticatedVote(t *testing.T) {
+ protocol.RunEncodingTest(t, &unauthenticatedVote{})
}
-func BenchmarkMarshalMsgselector(b *testing.B) {
- v := selector{}
+func BenchmarkMarshalMsgunauthenticatedVote(b *testing.B) {
+ v := unauthenticatedVote{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -588,8 +2148,8 @@ func BenchmarkMarshalMsgselector(b *testing.B) {
}
}
-func BenchmarkAppendMsgselector(b *testing.B) {
- v := selector{}
+func BenchmarkAppendMsgunauthenticatedVote(b *testing.B) {
+ v := unauthenticatedVote{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -600,8 +2160,8 @@ func BenchmarkAppendMsgselector(b *testing.B) {
}
}
-func BenchmarkUnmarshalselector(b *testing.B) {
- v := selector{}
+func BenchmarkUnmarshalunauthenticatedVote(b *testing.B) {
+ v := unauthenticatedVote{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -614,9 +2174,9 @@ func BenchmarkUnmarshalselector(b *testing.B) {
}
}
-func TestMarshalUnmarshaltransmittedPayload(t *testing.T) {
+func TestMarshalUnmarshalvote(t *testing.T) {
partitiontest.PartitionTest(t)
- v := transmittedPayload{}
+ v := vote{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -635,12 +2195,12 @@ func TestMarshalUnmarshaltransmittedPayload(t *testing.T) {
}
}
-func TestRandomizedEncodingtransmittedPayload(t *testing.T) {
- protocol.RunEncodingTest(t, &transmittedPayload{})
+func TestRandomizedEncodingvote(t *testing.T) {
+ protocol.RunEncodingTest(t, &vote{})
}
-func BenchmarkMarshalMsgtransmittedPayload(b *testing.B) {
- v := transmittedPayload{}
+func BenchmarkMarshalMsgvote(b *testing.B) {
+ v := vote{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -648,8 +2208,8 @@ func BenchmarkMarshalMsgtransmittedPayload(b *testing.B) {
}
}
-func BenchmarkAppendMsgtransmittedPayload(b *testing.B) {
- v := transmittedPayload{}
+func BenchmarkAppendMsgvote(b *testing.B) {
+ v := vote{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -660,8 +2220,8 @@ func BenchmarkAppendMsgtransmittedPayload(b *testing.B) {
}
}
-func BenchmarkUnmarshaltransmittedPayload(b *testing.B) {
- v := transmittedPayload{}
+func BenchmarkUnmarshalvote(b *testing.B) {
+ v := vote{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -674,9 +2234,9 @@ func BenchmarkUnmarshaltransmittedPayload(b *testing.B) {
}
}
-func TestMarshalUnmarshalunauthenticatedBundle(t *testing.T) {
+func TestMarshalUnmarshalvoteAggregator(t *testing.T) {
partitiontest.PartitionTest(t)
- v := unauthenticatedBundle{}
+ v := voteAggregator{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -695,12 +2255,12 @@ func TestMarshalUnmarshalunauthenticatedBundle(t *testing.T) {
}
}
-func TestRandomizedEncodingunauthenticatedBundle(t *testing.T) {
- protocol.RunEncodingTest(t, &unauthenticatedBundle{})
+func TestRandomizedEncodingvoteAggregator(t *testing.T) {
+ protocol.RunEncodingTest(t, &voteAggregator{})
}
-func BenchmarkMarshalMsgunauthenticatedBundle(b *testing.B) {
- v := unauthenticatedBundle{}
+func BenchmarkMarshalMsgvoteAggregator(b *testing.B) {
+ v := voteAggregator{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -708,8 +2268,8 @@ func BenchmarkMarshalMsgunauthenticatedBundle(b *testing.B) {
}
}
-func BenchmarkAppendMsgunauthenticatedBundle(b *testing.B) {
- v := unauthenticatedBundle{}
+func BenchmarkAppendMsgvoteAggregator(b *testing.B) {
+ v := voteAggregator{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -720,8 +2280,8 @@ func BenchmarkAppendMsgunauthenticatedBundle(b *testing.B) {
}
}
-func BenchmarkUnmarshalunauthenticatedBundle(b *testing.B) {
- v := unauthenticatedBundle{}
+func BenchmarkUnmarshalvoteAggregator(b *testing.B) {
+ v := voteAggregator{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -734,9 +2294,9 @@ func BenchmarkUnmarshalunauthenticatedBundle(b *testing.B) {
}
}
-func TestMarshalUnmarshalunauthenticatedEquivocationVote(t *testing.T) {
+func TestMarshalUnmarshalvoteAuthenticator(t *testing.T) {
partitiontest.PartitionTest(t)
- v := unauthenticatedEquivocationVote{}
+ v := voteAuthenticator{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -755,12 +2315,12 @@ func TestMarshalUnmarshalunauthenticatedEquivocationVote(t *testing.T) {
}
}
-func TestRandomizedEncodingunauthenticatedEquivocationVote(t *testing.T) {
- protocol.RunEncodingTest(t, &unauthenticatedEquivocationVote{})
+func TestRandomizedEncodingvoteAuthenticator(t *testing.T) {
+ protocol.RunEncodingTest(t, &voteAuthenticator{})
}
-func BenchmarkMarshalMsgunauthenticatedEquivocationVote(b *testing.B) {
- v := unauthenticatedEquivocationVote{}
+func BenchmarkMarshalMsgvoteAuthenticator(b *testing.B) {
+ v := voteAuthenticator{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -768,8 +2328,8 @@ func BenchmarkMarshalMsgunauthenticatedEquivocationVote(b *testing.B) {
}
}
-func BenchmarkAppendMsgunauthenticatedEquivocationVote(b *testing.B) {
- v := unauthenticatedEquivocationVote{}
+func BenchmarkAppendMsgvoteAuthenticator(b *testing.B) {
+ v := voteAuthenticator{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -780,8 +2340,8 @@ func BenchmarkAppendMsgunauthenticatedEquivocationVote(b *testing.B) {
}
}
-func BenchmarkUnmarshalunauthenticatedEquivocationVote(b *testing.B) {
- v := unauthenticatedEquivocationVote{}
+func BenchmarkUnmarshalvoteAuthenticator(b *testing.B) {
+ v := voteAuthenticator{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -794,9 +2354,9 @@ func BenchmarkUnmarshalunauthenticatedEquivocationVote(b *testing.B) {
}
}
-func TestMarshalUnmarshalunauthenticatedProposal(t *testing.T) {
+func TestMarshalUnmarshalvoteTracker(t *testing.T) {
partitiontest.PartitionTest(t)
- v := unauthenticatedProposal{}
+ v := voteTracker{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -815,12 +2375,12 @@ func TestMarshalUnmarshalunauthenticatedProposal(t *testing.T) {
}
}
-func TestRandomizedEncodingunauthenticatedProposal(t *testing.T) {
- protocol.RunEncodingTest(t, &unauthenticatedProposal{})
+func TestRandomizedEncodingvoteTracker(t *testing.T) {
+ protocol.RunEncodingTest(t, &voteTracker{})
}
-func BenchmarkMarshalMsgunauthenticatedProposal(b *testing.B) {
- v := unauthenticatedProposal{}
+func BenchmarkMarshalMsgvoteTracker(b *testing.B) {
+ v := voteTracker{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -828,8 +2388,8 @@ func BenchmarkMarshalMsgunauthenticatedProposal(b *testing.B) {
}
}
-func BenchmarkAppendMsgunauthenticatedProposal(b *testing.B) {
- v := unauthenticatedProposal{}
+func BenchmarkAppendMsgvoteTracker(b *testing.B) {
+ v := voteTracker{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -840,8 +2400,8 @@ func BenchmarkAppendMsgunauthenticatedProposal(b *testing.B) {
}
}
-func BenchmarkUnmarshalunauthenticatedProposal(b *testing.B) {
- v := unauthenticatedProposal{}
+func BenchmarkUnmarshalvoteTracker(b *testing.B) {
+ v := voteTracker{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -854,9 +2414,9 @@ func BenchmarkUnmarshalunauthenticatedProposal(b *testing.B) {
}
}
-func TestMarshalUnmarshalunauthenticatedVote(t *testing.T) {
+func TestMarshalUnmarshalvoteTrackerContract(t *testing.T) {
partitiontest.PartitionTest(t)
- v := unauthenticatedVote{}
+ v := voteTrackerContract{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -875,12 +2435,12 @@ func TestMarshalUnmarshalunauthenticatedVote(t *testing.T) {
}
}
-func TestRandomizedEncodingunauthenticatedVote(t *testing.T) {
- protocol.RunEncodingTest(t, &unauthenticatedVote{})
+func TestRandomizedEncodingvoteTrackerContract(t *testing.T) {
+ protocol.RunEncodingTest(t, &voteTrackerContract{})
}
-func BenchmarkMarshalMsgunauthenticatedVote(b *testing.B) {
- v := unauthenticatedVote{}
+func BenchmarkMarshalMsgvoteTrackerContract(b *testing.B) {
+ v := voteTrackerContract{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -888,8 +2448,8 @@ func BenchmarkMarshalMsgunauthenticatedVote(b *testing.B) {
}
}
-func BenchmarkAppendMsgunauthenticatedVote(b *testing.B) {
- v := unauthenticatedVote{}
+func BenchmarkAppendMsgvoteTrackerContract(b *testing.B) {
+ v := voteTrackerContract{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -900,8 +2460,8 @@ func BenchmarkAppendMsgunauthenticatedVote(b *testing.B) {
}
}
-func BenchmarkUnmarshalunauthenticatedVote(b *testing.B) {
- v := unauthenticatedVote{}
+func BenchmarkUnmarshalvoteTrackerContract(b *testing.B) {
+ v := voteTrackerContract{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -914,9 +2474,9 @@ func BenchmarkUnmarshalunauthenticatedVote(b *testing.B) {
}
}
-func TestMarshalUnmarshalvote(t *testing.T) {
+func TestMarshalUnmarshalvoteTrackerPeriod(t *testing.T) {
partitiontest.PartitionTest(t)
- v := vote{}
+ v := voteTrackerPeriod{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -935,12 +2495,12 @@ func TestMarshalUnmarshalvote(t *testing.T) {
}
}
-func TestRandomizedEncodingvote(t *testing.T) {
- protocol.RunEncodingTest(t, &vote{})
+func TestRandomizedEncodingvoteTrackerPeriod(t *testing.T) {
+ protocol.RunEncodingTest(t, &voteTrackerPeriod{})
}
-func BenchmarkMarshalMsgvote(b *testing.B) {
- v := vote{}
+func BenchmarkMarshalMsgvoteTrackerPeriod(b *testing.B) {
+ v := voteTrackerPeriod{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -948,8 +2508,8 @@ func BenchmarkMarshalMsgvote(b *testing.B) {
}
}
-func BenchmarkAppendMsgvote(b *testing.B) {
- v := vote{}
+func BenchmarkAppendMsgvoteTrackerPeriod(b *testing.B) {
+ v := voteTrackerPeriod{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -960,8 +2520,8 @@ func BenchmarkAppendMsgvote(b *testing.B) {
}
}
-func BenchmarkUnmarshalvote(b *testing.B) {
- v := vote{}
+func BenchmarkUnmarshalvoteTrackerPeriod(b *testing.B) {
+ v := voteTrackerPeriod{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
@@ -974,9 +2534,9 @@ func BenchmarkUnmarshalvote(b *testing.B) {
}
}
-func TestMarshalUnmarshalvoteAuthenticator(t *testing.T) {
+func TestMarshalUnmarshalvoteTrackerRound(t *testing.T) {
partitiontest.PartitionTest(t)
- v := voteAuthenticator{}
+ v := voteTrackerRound{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -995,12 +2555,12 @@ func TestMarshalUnmarshalvoteAuthenticator(t *testing.T) {
}
}
-func TestRandomizedEncodingvoteAuthenticator(t *testing.T) {
- protocol.RunEncodingTest(t, &voteAuthenticator{})
+func TestRandomizedEncodingvoteTrackerRound(t *testing.T) {
+ protocol.RunEncodingTest(t, &voteTrackerRound{})
}
-func BenchmarkMarshalMsgvoteAuthenticator(b *testing.B) {
- v := voteAuthenticator{}
+func BenchmarkMarshalMsgvoteTrackerRound(b *testing.B) {
+ v := voteTrackerRound{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -1008,8 +2568,8 @@ func BenchmarkMarshalMsgvoteAuthenticator(b *testing.B) {
}
}
-func BenchmarkAppendMsgvoteAuthenticator(b *testing.B) {
- v := voteAuthenticator{}
+func BenchmarkAppendMsgvoteTrackerRound(b *testing.B) {
+ v := voteTrackerRound{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -1020,8 +2580,8 @@ func BenchmarkAppendMsgvoteAuthenticator(b *testing.B) {
}
}
-func BenchmarkUnmarshalvoteAuthenticator(b *testing.B) {
- v := voteAuthenticator{}
+func BenchmarkUnmarshalvoteTrackerRound(b *testing.B) {
+ v := voteTrackerRound{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
diff --git a/agreement/persistence.go b/agreement/persistence.go
index aef2a0f609..497e4b9af0 100644
--- a/agreement/persistence.go
+++ b/agreement/persistence.go
@@ -33,10 +33,14 @@ import (
// diskState represents the state required by the agreement protocol to be persistent.
type diskState struct {
- Router, Player, Clock []byte
+ _struct struct{} `codec:","`
- ActionTypes []actionType
- Actions [][]byte
+ Router []byte
+ Player []byte
+ Clock []byte
+
+ ActionTypes []actionType `codec:"ActionTypes,allocbound=-"`
+ Actions [][]byte `codec:"Actions,allocbound=-"`
}
func persistent(as []action) bool {
@@ -49,17 +53,30 @@ func persistent(as []action) bool {
}
// encode serializes the current state into a byte array.
-func encode(t timers.Clock, rr rootRouter, p player, a []action) []byte {
+func encode(t timers.Clock, rr rootRouter, p player, a []action, reflect bool) (raw []byte) {
var s diskState
- s.Router = protocol.EncodeReflect(rr)
- s.Player = protocol.EncodeReflect(p)
+ if reflect {
+ s.Router = protocol.EncodeReflect(rr)
+ s.Player = protocol.EncodeReflect(p)
+ } else {
+ s.Router = protocol.Encode(&rr)
+ s.Player = protocol.Encode(&p)
+ }
s.Clock = t.Encode()
- for _, act := range a {
- s.ActionTypes = append(s.ActionTypes, act.t())
- s.Actions = append(s.Actions, protocol.EncodeReflect(act))
+ s.ActionTypes = make([]actionType, len(a))
+ s.Actions = make([][]byte, len(a))
+ for i, act := range a {
+ s.ActionTypes[i] = act.t()
+
+ // still use reflection for actions since action is an interface and we can't define marshaller methods on it
+ s.Actions[i] = protocol.EncodeReflect(act)
}
- raw := protocol.EncodeReflect(s)
- return raw
+ if reflect {
+ raw = protocol.EncodeReflect(s)
+ } else {
+ raw = protocol.Encode(&s)
+ }
+ return
}
// persist atomically writes state to the crash database.
@@ -177,17 +194,28 @@ func restore(log logging.Logger, crash db.Accessor) (raw []byte, err error) {
// decode process the incoming raw bytes array and attempt to reconstruct the agreement state objects.
//
// In all decoding errors, it returns the error code in err
-func decode(raw []byte, t0 timers.Clock, log serviceLogger) (t timers.Clock, rr rootRouter, p player, a []action, err error) {
+func decode(raw []byte, t0 timers.Clock, log serviceLogger, reflect bool) (t timers.Clock, rr rootRouter, p player, a []action, err error) {
var t2 timers.Clock
var rr2 rootRouter
var p2 player
a2 := []action{}
var s diskState
-
- err = protocol.DecodeReflect(raw, &s)
- if err != nil {
- log.Errorf("decode (agreement): error decoding retrieved state (len = %v): %v", len(raw), err)
- return
+ if reflect {
+ err = protocol.DecodeReflect(raw, &s)
+ if err != nil {
+ log.Errorf("decode (agreement): error decoding retrieved state (len = %v): %v", len(raw), err)
+ return
+ }
+ } else {
+ err = protocol.Decode(raw, &s)
+ if err != nil {
+ log.Warnf("decode (agreement): error decoding retrieved state using msgp (len = %v): %v. Trying reflection", len(raw), err)
+ err = protocol.DecodeReflect(raw, &s)
+ if err != nil {
+ log.Errorf("decode (agreement): error decoding using either reflection or msgp): %v", err)
+ return
+ }
+ }
}
t2, err = t0.Decode(s.Clock)
@@ -195,19 +223,43 @@ func decode(raw []byte, t0 timers.Clock, log serviceLogger) (t timers.Clock, rr
return
}
- err = protocol.DecodeReflect(s.Player, &p2)
- if err != nil {
- return
- }
+ if reflect {
+ err = protocol.DecodeReflect(s.Player, &p2)
+ if err != nil {
+ return
+ }
- rr2 = makeRootRouter(p2)
- err = protocol.DecodeReflect(s.Router, &rr2)
- if err != nil {
- return
+ rr2 = makeRootRouter(p2)
+ err = protocol.DecodeReflect(s.Router, &rr2)
+ if err != nil {
+ return
+ }
+ } else {
+ err = protocol.Decode(s.Player, &p2)
+ if err != nil {
+ log.Warnf("decode (agreement): failed to decode Player using msgp (len = %v): %v. Trying reflection", len(s.Player), err)
+ err = protocol.DecodeReflect(s.Player, &p2)
+ if err != nil {
+ log.Errorf("decode (agreement): failed to decode Player using either reflection or msgp: %v", err)
+ return
+ }
+ }
+ rr2 = makeRootRouter(p2)
+ err = protocol.Decode(s.Router, &rr2)
+ if err != nil {
+ log.Warnf("decode (agreement): failed to decode Router using msgp (len = %v): %v. Trying reflection", len(s.Router), err)
+ rr2 = makeRootRouter(p2)
+ err = protocol.DecodeReflect(s.Router, &rr2)
+ if err != nil {
+ log.Errorf("decode (agreement): failed to decode Router using either reflection or msgp: %v", err)
+ return
+ }
+ }
}
for i := range s.Actions {
act := zeroAction(s.ActionTypes[i])
+ // always use reflection for actions since action is an interface and we can't define unmarshaller methods on it
err = protocol.DecodeReflect(s.Actions[i], &act)
if err != nil {
return
@@ -308,7 +360,7 @@ func (p *asyncPersistenceLoop) loop(ctx context.Context) {
// sanity check; we check it after the fact, since it's not expected to ever happen.
// performance-wise, it takes approximitly 300000ns to execute, and we don't want it to
// block the persist operation.
- _, _, _, _, derr := decode(s.raw, s.clock, p.log)
+ _, _, _, _, derr := decode(s.raw, s.clock, p.log, false)
if derr != nil {
p.log.Errorf("could not decode own encoded disk state: %v", derr)
}
diff --git a/agreement/persistence_test.go b/agreement/persistence_test.go
index 94221f7be4..7a4ec3db4d 100644
--- a/agreement/persistence_test.go
+++ b/agreement/persistence_test.go
@@ -25,7 +25,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/algorand/go-algorand/crypto"
+ "github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/logging"
+ "github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/test/partitiontest"
"github.com/algorand/go-algorand/util/db"
"github.com/algorand/go-algorand/util/timers"
@@ -34,17 +36,17 @@ import (
func TestAgreementSerialization(t *testing.T) {
partitiontest.PartitionTest(t)
- // todo : we need to deserialize some more meaningfull state.
+ // todo : we need to deserialize some more meaningful state.
clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
status := player{Round: 350, Step: soft, Deadline: time.Duration(23) * time.Second}
router := makeRootRouter(status)
- a := []action{}
+ a := []action{checkpointAction{}, disconnectAction(messageEvent{}, nil)}
- encodedBytes := encode(clock, router, status, a)
+ encodedBytes := encode(clock, router, status, a, false)
t0 := timers.MakeMonotonicClock(time.Date(2000, 0, 0, 0, 0, 0, 0, time.UTC))
log := makeServiceLogger(logging.Base())
- clock2, router2, status2, a2, err := decode(encodedBytes, t0, log)
+ clock2, router2, status2, a2, err := decode(encodedBytes, t0, log, false)
require.NoError(t, err)
require.Equalf(t, clock, clock2, "Clock wasn't serialized/deserialized correctly")
require.Equalf(t, router, router2, "Router wasn't serialized/deserialized correctly")
@@ -53,7 +55,7 @@ func TestAgreementSerialization(t *testing.T) {
}
func BenchmarkAgreementSerialization(b *testing.B) {
- // todo : we need to deserialize some more meaningfull state.
+ // todo : we need to deserialize some more meaningful state.
b.SkipNow()
clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
@@ -63,12 +65,12 @@ func BenchmarkAgreementSerialization(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
- encode(clock, router, status, a)
+ encode(clock, router, status, a, false)
}
}
func BenchmarkAgreementDeserialization(b *testing.B) {
- // todo : we need to deserialize some more meaningfull state.
+ // todo : we need to deserialize some more meaningful state.
b.SkipNow()
clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
@@ -76,12 +78,12 @@ func BenchmarkAgreementDeserialization(b *testing.B) {
router := makeRootRouter(status)
a := []action{}
- encodedBytes := encode(clock, router, status, a)
+ encodedBytes := encode(clock, router, status, a, false)
t0 := timers.MakeMonotonicClock(time.Date(2000, 0, 0, 0, 0, 0, 0, time.UTC))
log := makeServiceLogger(logging.Base())
b.ResetTimer()
for n := 0; n < b.N; n++ {
- decode(encodedBytes, t0, log)
+ decode(encodedBytes, t0, log, false)
}
}
@@ -163,3 +165,124 @@ func BenchmarkAgreementPersistenceRecovery(b *testing.B) {
restore(serviceLogger{Logger: logging.Base()}, accessor)
}
}
+
+func randomizeDiskState() (rr rootRouter, p player) {
+ p2, err := protocol.RandomizeObject(&player{})
+ if err != nil {
+ return
+ }
+ rr2, err := protocol.RandomizeObject(&rootRouter{})
+ if err != nil {
+ return
+ }
+ p = *(p2.(*player))
+ rr = *(rr2.(*rootRouter))
+ return
+}
+
+func TestRandomizedEncodingFullDiskState(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ for i := 0; i < 5000; i++ {
+ router, player := randomizeDiskState()
+ a := []action{}
+ clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
+ log := makeServiceLogger(logging.Base())
+ e1 := encode(clock, router, player, a, true)
+ e2 := encode(clock, router, player, a, false)
+ require.Equalf(t, e1, e2, "msgp and go-codec encodings differ: len(msgp)=%v, len(reflect)=%v", len(e1), len(e2))
+ _, rr1, p1, _, err1 := decode(e1, clock, log, true)
+ _, rr2, p2, _, err2 := decode(e1, clock, log, false)
+ require.NoErrorf(t, err1, "reflect decoding failed")
+ require.NoErrorf(t, err2, "msgp decoding failed")
+ require.Equalf(t, rr1, rr2, "rootRouters decoded differently")
+ require.Equalf(t, p1, p2, "players decoded differently")
+ }
+
+}
+
+func BenchmarkRandomizedEncode(b *testing.B) {
+ clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
+ router, player := randomizeDiskState()
+ a := []action{}
+ b.ResetTimer()
+ for n := 0; n < b.N; n++ {
+ encode(clock, router, player, a, false)
+ }
+}
+
+func BenchmarkRandomizedDecode(b *testing.B) {
+ clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
+ router, player := randomizeDiskState()
+ a := []action{}
+ ds := encode(clock, router, player, a, false)
+ log := makeServiceLogger(logging.Base())
+ b.ResetTimer()
+ for n := 0; n < b.N; n++ {
+ decode(ds, clock, log, false)
+ }
+}
+
+func TestEmptyMapDeserialization(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ var rr, rr1 rootRouter
+ rr.Children = make(map[basics.Round]*roundRouter)
+ e := protocol.Encode(&rr)
+ err := protocol.Decode(e, &rr1)
+ require.NoError(t, err)
+ require.NotNil(t, rr1.Children)
+
+ var v, v1 voteTracker
+ v.Equivocators = make(map[basics.Address]equivocationVote)
+ ve := protocol.Encode(&v)
+ err = protocol.Decode(ve, &v1)
+ require.NoError(t, err)
+ require.NotNil(t, v1.Equivocators)
+}
+
+func TestDecodeFailures(t *testing.T) {
+ clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC))
+ ce := clock.Encode()
+ log := makeServiceLogger(logging.Base())
+ player := player{Round: 350, Step: soft, Deadline: time.Duration(23) * time.Second}
+ router := makeRootRouter(player)
+ pe := protocol.Encode(&player)
+ re := protocol.Encode(&router)
+
+ // diskState decoding failure
+ {
+ type diskState struct {
+ UnexpectedDiskField int64
+ }
+ uds := diskState{UnexpectedDiskField: 5}
+ udse := protocol.EncodeReflect(uds)
+ _, _, _, _, err := decode(udse, clock, log, false)
+ require.ErrorContains(t, err, "UnexpectedDiskField")
+
+ }
+
+ // player decoding failure
+ {
+ type player struct {
+ UnexpectedPlayerField int64
+ }
+ p := player{UnexpectedPlayerField: 3}
+ pe := protocol.EncodeReflect(p)
+ ds := diskState{Player: pe, Router: re, Clock: ce}
+ dse := protocol.EncodeReflect(ds)
+ _, _, _, _, err := decode(dse, clock, log, false)
+ require.ErrorContains(t, err, "UnexpectedPlayerField")
+ }
+
+ // router decoding failure
+ {
+ type rootRouter struct {
+ UnexpectedRouterField int64
+ }
+ router := rootRouter{UnexpectedRouterField: 5}
+ re := protocol.EncodeReflect(router)
+ ds := diskState{Player: pe, Router: re, Clock: ce}
+ dse := protocol.EncodeReflect(ds)
+ _, _, _, _, err := decode(dse, clock, log, false)
+ require.ErrorContains(t, err, "UnexpectedRouterField")
+ }
+}
diff --git a/agreement/player.go b/agreement/player.go
index 2add5711e4..cc29240aa7 100644
--- a/agreement/player.go
+++ b/agreement/player.go
@@ -26,6 +26,7 @@ import (
// The player implements the top-level state machine functionality of the
// agreement protocol.
type player struct {
+ _struct struct{} `codec:","`
// Round, Period, and Step hold the current round, period, and step of
// the player state machine.
Round round
@@ -391,7 +392,7 @@ func (p *player) enterRound(r routerHandle, source event, target round) []action
if e.t() == payloadPipelined {
e := e.(payloadProcessedEvent)
- msg := message{MessageHandle: 0, Tag: protocol.ProposalPayloadTag, UnauthenticatedProposal: e.UnauthenticatedPayload} // TODO do we want to keep around the original handle?
+ msg := message{messageHandle: 0, Tag: protocol.ProposalPayloadTag, UnauthenticatedProposal: e.UnauthenticatedPayload} // TODO do we want to keep around the original handle?
a := verifyPayloadAction(messageEvent{T: payloadPresent, Input: msg}, p.Round, e.Period, e.Pinned)
actions = append(actions, a)
}
@@ -570,7 +571,7 @@ func (p *player) handleMessageEvent(r routerHandle, e messageEvent) (actions []a
}
// relay as the proposer
- if e.Input.MessageHandle == nil {
+ if e.Input.messageHandle == nil {
var uv unauthenticatedVote
switch ef.t() {
case payloadPipelined, payloadAccepted:
diff --git a/agreement/player_permutation_test.go b/agreement/player_permutation_test.go
index 251a276229..d7dcf9add8 100644
--- a/agreement/player_permutation_test.go
+++ b/agreement/player_permutation_test.go
@@ -69,7 +69,7 @@ func getPlayerPermutation(t *testing.T, n int) (plyr *player, pMachine ioAutomat
plyr.Pending.push(&messageEvent{
T: payloadPresent,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
UnauthenticatedProposal: payload.u(),
},
})
@@ -161,7 +161,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: voteVerified,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
Vote: vvote,
UnauthenticatedVote: vvote.u(),
},
@@ -172,7 +172,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: votePresent,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
UnauthenticatedVote: vvote.u(),
},
Proto: ConsensusVersionView{Version: protocol.ConsensusCurrentVersion},
@@ -182,7 +182,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: voteVerified,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
Vote: vvote,
UnauthenticatedVote: vvote.u(),
},
@@ -193,7 +193,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: voteVerified,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
Vote: vvote,
UnauthenticatedVote: vvote.u(),
},
@@ -205,7 +205,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: votePresent,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
UnauthenticatedVote: vvote.u(),
},
Proto: ConsensusVersionView{Version: protocol.ConsensusCurrentVersion},
@@ -214,7 +214,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: payloadPresent,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
UnauthenticatedProposal: payload.u(),
},
}
@@ -222,7 +222,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: payloadVerified,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
UnauthenticatedProposal: payload.u(),
Proposal: *payload,
},
@@ -278,7 +278,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: voteVerified,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
Vote: vvote,
UnauthenticatedVote: vvote.u(),
},
@@ -290,7 +290,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
e = messageEvent{
T: voteVerified,
Input: message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
Vote: vvote,
UnauthenticatedVote: vvote.u(),
},
@@ -303,7 +303,7 @@ func getMessageEventPermutation(t *testing.T, n int, helper *voteMakerHelper) (e
Input: message{
Bundle: bundle{},
UnauthenticatedBundle: unauthenticatedBundle{},
- MessageHandle: "uniquemalformedBundle",
+ messageHandle: "uniquemalformedBundle",
},
Err: errTestVerifyFailed,
}
diff --git a/agreement/player_test.go b/agreement/player_test.go
index ecd871bc14..3e3cf8167b 100644
--- a/agreement/player_test.go
+++ b/agreement/player_test.go
@@ -1877,7 +1877,7 @@ func TestPlayerPropagatesProposalPayload(t *testing.T) {
require.NoError(t, panicErr)
m := message{
- MessageHandle: "msghandle",
+ messageHandle: "msghandle",
UnauthenticatedProposal: payload.u(),
}
inMsg = messageEvent{
@@ -1952,7 +1952,7 @@ func TestPlayerPropagatesProposalPayloadFutureRound(t *testing.T) {
require.NoError(t, panicErr)
m := message{
- MessageHandle: "msghandle",
+ messageHandle: "msghandle",
UnauthenticatedProposal: payload.u(),
}
inMsg = messageEvent{
@@ -2269,7 +2269,7 @@ func TestPlayerDisconnectsFromMalformedProposalVote(t *testing.T) {
return false
}
act := wrapper.action.(networkAction)
- if act.T == disconnect && act.h == m.MessageHandle && act.Err != nil {
+ if act.T == disconnect && act.h == m.messageHandle && act.Err != nil {
return true
}
return false
@@ -2287,7 +2287,7 @@ func TestPlayerIgnoresMalformedPayload(t *testing.T) {
// check ignore on malformed payloads
m := message{
- MessageHandle: "uniquemessage",
+ messageHandle: "uniquemessage",
Proposal: proposal{},
UnauthenticatedProposal: unauthenticatedProposal{},
}
@@ -2308,7 +2308,7 @@ func TestPlayerIgnoresMalformedPayload(t *testing.T) {
return false
}
act := wrapper.action.(networkAction)
- if act.T == ignore && act.h == m.MessageHandle && act.Err != nil {
+ if act.T == ignore && act.h == m.messageHandle && act.Err != nil {
return true
}
return false
@@ -2329,7 +2329,7 @@ func TestPlayerDisconnectsFromMalformedVotes(t *testing.T) {
m := message{
Vote: vv,
UnauthenticatedVote: vv.u(),
- MessageHandle: "uniquemalformedvote",
+ messageHandle: "uniquemalformedvote",
}
inMsg := messageEvent{
T: voteVerified,
@@ -2348,7 +2348,7 @@ func TestPlayerDisconnectsFromMalformedVotes(t *testing.T) {
return false
}
act := wrapper.action.(networkAction)
- if act.T == disconnect && act.h == m.MessageHandle && act.Err != nil {
+ if act.T == disconnect && act.h == m.messageHandle && act.Err != nil {
return true
}
return false
@@ -2368,7 +2368,7 @@ func TestPlayerDisconnectsFromMalformedBundles(t *testing.T) {
m := message{
Bundle: bundle{},
UnauthenticatedBundle: unauthenticatedBundle{},
- MessageHandle: "uniquemalformedBundle",
+ messageHandle: "uniquemalformedBundle",
}
inMsg := messageEvent{
Err: verifyError,
@@ -2387,7 +2387,7 @@ func TestPlayerDisconnectsFromMalformedBundles(t *testing.T) {
return false
}
act := wrapper.action.(networkAction)
- if act.T == disconnect && act.h == m.MessageHandle && act.Err != nil {
+ if act.T == disconnect && act.h == m.messageHandle && act.Err != nil {
return true
}
return false
@@ -2524,7 +2524,7 @@ func TestPlayerRequestsPipelinedPayloadVerification(t *testing.T) {
require.NoError(t, panicErr)
m := message{
UnauthenticatedProposal: payloadTwo.u(),
- MessageHandle: "r2",
+ messageHandle: "r2",
}
inMsg = messageEvent{
T: payloadPresent,
diff --git a/agreement/proposalManager.go b/agreement/proposalManager.go
index 8cf03b32fe..5abe5f0528 100644
--- a/agreement/proposalManager.go
+++ b/agreement/proposalManager.go
@@ -28,7 +28,10 @@ import (
// payload{Present,Verified}, roundInterruption, {soft,cert,next}Threshold.
// It returns the following type(s) of event: none, vote{Filtered,Malformed},
// payload{Pipelined,Rejected,Accepted}, and proposal{Accepted,Committable}.
-type proposalManager struct{}
+
+type proposalManager struct {
+ _struct struct{} `codec:","`
+}
func (m *proposalManager) T() stateMachineTag {
return proposalMachine
diff --git a/agreement/proposalStore.go b/agreement/proposalStore.go
index e375ef92f8..841dc91b9b 100644
--- a/agreement/proposalStore.go
+++ b/agreement/proposalStore.go
@@ -37,6 +37,7 @@ var proposalAlreadyAssembledCounter = metrics.MakeCounter(
// Once a proposal is successfully validated, it is stored by the
// blockAssembler.
type blockAssembler struct {
+ _struct struct{} `codec:","`
// Pipeline contains a proposal which has not yet been validated. The
// proposal might be inside the cryptoVerifier, or it might be a
// pipelined proposal from the next round.
@@ -53,7 +54,7 @@ type blockAssembler struct {
// for a given proposal-value. When a proposal payload is relayed by
// the state machine, a matching can be concatenated with the vote to
// ensure that peers do not drop the proposal payload.
- Authenticators []vote
+ Authenticators []vote `codec:"Authenticators,allocbound=-"`
}
// pipeline adds the given unvalidated proposal to the blockAssembler, returning
@@ -120,11 +121,12 @@ func (a blockAssembler) trim(p period) blockAssembler {
// It returns the following type(s) of event: none, voteFiltered,
// proposal{Accepted,Committable}, and payload{Pipelined,Rejected}.
type proposalStore struct {
+ _struct struct{} `codec:","`
// Relevant contains a current collection of important proposal-values
// in the round. Relevant is indexed by period, and the proposalValue is
// the last one reported by the corresponding proposalMachinePeriod.
// Each corresponding proposal is tracked in Assemblers.
- Relevant map[period]proposalValue
+ Relevant map[period]proposalValue `codec:"Relevant,allocbound=-"`
// Pinned contains the extra proposal-value, not tracked in Relevant,
// for which a certificate may have formed (i.e., vbar in the spec).
// The proposal corresponding to Pinned is tracked in Assemblers.
@@ -132,7 +134,7 @@ type proposalStore struct {
// Assemblers contains the set of proposal-values currently tracked and
// held by the proposalStore.
- Assemblers map[proposalValue]blockAssembler
+ Assemblers map[proposalValue]blockAssembler `codec:"Assemblers,allocbound=-"`
}
func (store *proposalStore) T() stateMachineTag {
diff --git a/agreement/proposalTable.go b/agreement/proposalTable.go
index 79448f4032..b3ef71ac6a 100644
--- a/agreement/proposalTable.go
+++ b/agreement/proposalTable.go
@@ -19,22 +19,24 @@ package agreement
// A proposalTable stores proposals which need to be authenticated
// after their prior votes have been processed.
type proposalTable struct {
- Pending map[int]*messageEvent
- PendingNext int
+ _struct struct{} `codec:",omitempty,omitemptyarray"`
+
+ Pending map[uint64]*messageEvent `codec:"Pending,allocbound=-"`
+ PendingNext uint64
}
// push adds a proposal to the proposalTable.
-func (t *proposalTable) push(e *messageEvent) int {
+func (t *proposalTable) push(e *messageEvent) uint64 {
t.PendingNext++
if t.Pending == nil {
- t.Pending = make(map[int]*messageEvent)
+ t.Pending = make(map[uint64]*messageEvent)
}
t.Pending[t.PendingNext] = e
return t.PendingNext
}
// pop takes a proposal from the proposalTable.
-func (t *proposalTable) pop(taskIndex int) *messageEvent {
+func (t *proposalTable) pop(taskIndex uint64) *messageEvent {
res := t.Pending[taskIndex]
delete(t.Pending, taskIndex)
return res
diff --git a/agreement/proposalTable_test.go b/agreement/proposalTable_test.go
new file mode 100644
index 0000000000..af81305fb1
--- /dev/null
+++ b/agreement/proposalTable_test.go
@@ -0,0 +1,69 @@
+// Copyright (C) 2019-2022 Algorand, Inc.
+// This file is part of go-algorand
+//
+// go-algorand is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// go-algorand is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with go-algorand. If not, see .
+
+package agreement
+
+import (
+ "encoding/base64"
+ "testing"
+
+ "github.com/algorand/go-algorand/network"
+ "github.com/algorand/go-algorand/protocol"
+ "github.com/algorand/go-algorand/test/partitiontest"
+ "github.com/stretchr/testify/require"
+)
+
+// This test is only necessary for transition to msgp encoding
+// of the player state machine for agreement persistence
+func TestProposalTableMsgpEncoding(t *testing.T) {
+ partitiontest.PartitionTest(t)
+
+ type messageMetadata struct {
+ raw network.IncomingMessage
+ }
+ encoded, err := base64.StdEncoding.DecodeString("gqdQZW5kaW5ngQGHqUNhbmNlbGxlZMKjRXJywKVJbnB1dImmQnVuZGxlgK9Db21wb3VuZE1lc3NhZ2WCqFByb3Bvc2FsgKRWb3RlgK1NZXNzYWdlSGFuZGxlgKhQcm9wb3NhbICjVGFnolBQtVVuYXV0aGVudGljYXRlZEJ1bmRsZYC3VW5hdXRoZW50aWNhdGVkUHJvcG9zYWyAs1VuYXV0aGVudGljYXRlZFZvdGWApFZvdGWApVByb3RvgqNFcnLAp1ZlcnNpb26goVQApFRhaWzAqVRhc2tJbmRleD+rUGVuZGluZ05leHQB")
+ require.NoError(t, err)
+
+ // run on master a3e90ad to get the encoded data for above
+ // pt := proposalTable{}
+ // msg := messageEvent{
+ // Input: message{
+ // Tag: protocol.ProposalPayloadTag,
+ // MessageHandle: &messageMetadata{raw: network.IncomingMessage{Tag: protocol.Tag("mytag"), Data: []byte("some data")}},
+ // },
+ // TaskIndex: 63}
+ // pt.push(&msg)
+ // result := protocol.EncodeReflect(&pt)
+ // fmt.Println(base64.StdEncoding.EncodeToString(result))
+
+ var ptMsgp, ptReflect proposalTable
+ err = protocol.Decode(encoded, &ptMsgp)
+ require.NoError(t, err)
+ err = protocol.DecodeReflect(encoded, &ptReflect)
+ require.NoError(t, err)
+
+ msgMsgp := ptMsgp.pop(ptMsgp.PendingNext)
+ msgReflect := ptReflect.pop(ptReflect.PendingNext)
+
+ // After setting MessageHandle to nil they should be the same
+ msgMsgp.Input.MessageHandle = nil
+ msgReflect.Input.MessageHandle = nil
+ require.Equal(t, msgMsgp, msgReflect)
+ // Check that the other fields we have manually set are still the same
+ require.Equal(t, msgMsgp.Input.Tag, protocol.ProposalPayloadTag)
+ require.Equal(t, msgMsgp.TaskIndex, uint64(63))
+
+}
diff --git a/agreement/proposalTracker.go b/agreement/proposalTracker.go
index c76c5c9fda..e3efcd372c 100644
--- a/agreement/proposalTracker.go
+++ b/agreement/proposalTracker.go
@@ -25,6 +25,7 @@ import (
// A proposalSeeker finds the vote with the lowest credential until freeze() is
// called.
type proposalSeeker struct {
+ _struct struct{} `codec:","`
// Lowest contains the vote with the lowest credential seen so far.
Lowest vote
// Filled is set if any vote has been seen.
@@ -66,10 +67,11 @@ func (s proposalSeeker) freeze() proposalSeeker {
// It returns the following type(s) of event: voteFiltered, proposalAccepted, readStaging,
// and proposalFrozen.
type proposalTracker struct {
+ _struct struct{} `codec:","`
// Duplicate holds the set of senders which has been seen by the
// proposalTracker. A duplicate proposal-vote or an equivocating
// proposal-vote is dropped by a proposalTracker.
- Duplicate map[basics.Address]bool
+ Duplicate map[basics.Address]bool `codec:"Duplicate,allocbound=-"`
// Freezer holds a proposalSeeker, which seeks the proposal-vote with
// the lowest credential seen by the proposalTracker.
Freezer proposalSeeker
diff --git a/agreement/proposalTrackerContract.go b/agreement/proposalTrackerContract.go
index c33feb8413..bbe4911c2b 100644
--- a/agreement/proposalTrackerContract.go
+++ b/agreement/proposalTrackerContract.go
@@ -21,6 +21,8 @@ import (
)
type proposalTrackerContract struct {
+ _struct struct{} `codec:","`
+
SawOneVote bool
Froze bool
SawSoftThreshold bool
diff --git a/agreement/pseudonode.go b/agreement/pseudonode.go
index 06a91b210e..6075e8ebfc 100644
--- a/agreement/pseudonode.go
+++ b/agreement/pseudonode.go
@@ -387,7 +387,7 @@ func (t pseudonodeVotesTask) execute(verifier *AsyncVoteVerifier, quit chan stru
asyncVerifyingVotes := len(unverifiedVotes)
for i, uv := range unverifiedVotes {
msg := message{Tag: protocol.AgreementVoteTag, UnauthenticatedVote: uv}
- err := verifier.verifyVote(context.TODO(), t.node.ledger, uv, i, msg, results)
+ err := verifier.verifyVote(context.TODO(), t.node.ledger, uv, uint64(i), msg, results)
if err != nil {
orderedResults[i].err = err
t.node.log.Infof("pseudonode.makeVotes: failed to enqueue vote verification for (%d, %d): %v", t.round, t.period, err)
@@ -515,7 +515,7 @@ func (t pseudonodeProposalsTask) execute(verifier *AsyncVoteVerifier, quit chan
asyncVerifyingVotes := len(votes)
for i, uv := range votes {
msg := message{Tag: protocol.AgreementVoteTag, UnauthenticatedVote: uv}
- err := verifier.verifyVote(context.TODO(), t.node.ledger, uv, i, msg, results)
+ err := verifier.verifyVote(context.TODO(), t.node.ledger, uv, uint64(i), msg, results)
if err != nil {
cryptoOutputs[i].err = err
t.node.log.Infof("pseudonode.makeProposals: failed to enqueue vote verification for (%d, %d): %v", t.round, t.period, err)
diff --git a/agreement/router.go b/agreement/router.go
index fd0638a012..f6f0ea0105 100644
--- a/agreement/router.go
+++ b/agreement/router.go
@@ -66,6 +66,8 @@ type router interface {
}
type rootRouter struct {
+ _struct struct{} `codec:","`
+
root actor // playerMachine (not restored: explicitly set on construction)
proposalRoot listener // proposalMachine
voteRoot listener // voteMachine
@@ -73,20 +75,24 @@ type rootRouter struct {
ProposalManager proposalManager
VoteAggregator voteAggregator
- Children map[round]*roundRouter
+ Children map[round]*roundRouter `codec:"Children,allocbound=-"`
}
type roundRouter struct {
+ _struct struct{} `codec:","`
+
proposalRoot listener // proposalMachineRound
voteRoot listener // voteMachineRound
ProposalStore proposalStore
VoteTrackerRound voteTrackerRound
- Children map[period]*periodRouter
+ Children map[period]*periodRouter `codec:"Children,allocbound=-"`
}
type periodRouter struct {
+ _struct struct{} `codec:","`
+
proposalRoot listener // proposalMachinePeriod
voteRoot listener // voteMachinePeriod
@@ -95,10 +101,11 @@ type periodRouter struct {
ProposalTrackerContract proposalTrackerContract
- Children map[step]*stepRouter
+ Children map[step]*stepRouter `codec:"Children,allocbound=-"`
}
type stepRouter struct {
+ _struct struct{} `codec:","`
voteRoot listener // voteMachineStep
VoteTracker voteTracker
diff --git a/agreement/service.go b/agreement/service.go
index 3462349509..00b192b5c4 100644
--- a/agreement/service.go
+++ b/agreement/service.go
@@ -191,7 +191,7 @@ func (s *Service) mainLoop(input <-chan externalEvent, output chan<- []action, r
var err error
raw, err := restore(s.log, s.Accessor)
if err == nil {
- clock, router, status, a, err = decode(raw, s.Clock, s.log)
+ clock, router, status, a, err = decode(raw, s.Clock, s.log, false)
if err != nil {
reset(s.log, s.Accessor)
} else {
@@ -246,7 +246,7 @@ func (s *Service) mainLoop(input <-chan externalEvent, output chan<- []action, r
// usage semantics : caller should ensure to call this function only when we have participation
// keys for the given voting round.
func (s *Service) persistState(done chan error) (events <-chan externalEvent) {
- raw := encode(s.Clock, s.persistRouter, s.persistStatus, s.persistActions)
+ raw := encode(s.Clock, s.persistRouter, s.persistStatus, s.persistActions, false)
return s.persistenceLoop.Enqueue(s.Clock, s.persistStatus.Round, s.persistStatus.Period, s.persistStatus.Step, raw, done)
}
diff --git a/agreement/sort.go b/agreement/sort.go
new file mode 100644
index 0000000000..21fa3fc277
--- /dev/null
+++ b/agreement/sort.go
@@ -0,0 +1,84 @@
+// Copyright (C) 2019-2022 Algorand, Inc.
+// This file is part of go-algorand
+//
+// go-algorand is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// go-algorand is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with go-algorand. If not, see .
+
+package agreement
+
+import (
+ "bytes"
+
+ "github.com/algorand/go-algorand/data/basics"
+)
+
+// These types are defined to satisfy SortInterface used by
+
+// SortAddress is re-exported from basics.Address since the interface is already defined there
+//msgp:sort basics.Address SortAddress
+type SortAddress = basics.SortAddress
+
+// SortUint64 is re-exported from basics since the interface is already defined there
+// canonical encoding of maps in msgpack format.
+type SortUint64 = basics.SortUint64
+
+// SortStep defines SortInterface used by msgp to consistently sort maps with this type as key.
+//msgp:ignore SortStep
+//msgp:sort step SortStep
+type SortStep []step
+
+func (a SortStep) Len() int { return len(a) }
+func (a SortStep) Less(i, j int) bool { return a[i] < a[j] }
+func (a SortStep) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+
+// SortPeriod defines SortInterface used by msgp to consistently sort maps with this type as key.
+//msgp:ignore SortPeriod
+//msgp:sort period SortPeriod
+type SortPeriod []period
+
+func (a SortPeriod) Len() int { return len(a) }
+func (a SortPeriod) Less(i, j int) bool { return a[i] < a[j] }
+func (a SortPeriod) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+
+// SortRound defines SortInterface used by msgp to consistently sort maps with this type as key.
+//msgp:ignore SortRound
+//msgp:sort round SortRound
+type SortRound []round
+
+func (a SortRound) Len() int { return len(a) }
+func (a SortRound) Less(i, j int) bool { return a[i] < a[j] }
+func (a SortRound) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+
+// SortProposalValue defines SortInterface used by msgp to consistently sort maps with this type as key.
+//msgp:ignore SortProposalValue
+//msgp:sort proposalValue SortProposalValue
+type SortProposalValue []proposalValue
+
+func (a SortProposalValue) Len() int { return len(a) }
+func (a SortProposalValue) Less(i, j int) bool {
+ if a[i].OriginalPeriod != a[j].OriginalPeriod {
+ return a[i].OriginalPeriod < a[j].OriginalPeriod
+ }
+ cmp := bytes.Compare(a[i].OriginalProposer[:], a[j].OriginalProposer[:])
+ if cmp != 0 {
+ return cmp < 0
+ }
+ cmp = bytes.Compare(a[i].BlockDigest[:], a[j].BlockDigest[:])
+ if cmp != 0 {
+ return cmp < 0
+ }
+ cmp = bytes.Compare(a[i].EncodingDigest[:], a[j].EncodingDigest[:])
+ return cmp < 0
+}
+
+func (a SortProposalValue) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
diff --git a/agreement/sort_test.go b/agreement/sort_test.go
new file mode 100644
index 0000000000..8240e5eff3
--- /dev/null
+++ b/agreement/sort_test.go
@@ -0,0 +1,60 @@
+// Copyright (C) 2019-2022 Algorand, Inc.
+// This file is part of go-algorand
+//
+// go-algorand is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// go-algorand is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with go-algorand. If not, see .
+
+package agreement
+
+import (
+ "testing"
+
+ "github.com/algorand/go-algorand/crypto"
+ "github.com/algorand/go-algorand/data/basics"
+ "github.com/algorand/go-algorand/test/partitiontest"
+ "github.com/stretchr/testify/require"
+)
+
+func TestSortProposalValueLess(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ // initialize a new digest with all bytes being 'a'
+ d1 := new(crypto.Digest)
+ for i := range d1 {
+ d1[i] = byte('a')
+ }
+ p1 := proposalValue{
+ OriginalPeriod: 1,
+ OriginalProposer: basics.Address(*d1),
+ BlockDigest: *d1,
+ EncodingDigest: *d1,
+ }
+ sp := SortProposalValue{p1, p1}
+ // They are both equal so Less should return false regardless of order
+ require.Falsef(t, sp.Less(0, 1), "%v < %v is true for equal values", sp[0], sp[1])
+ require.Falsef(t, sp.Less(1, 0), "%v < %v is true for equal values", sp[1], sp[0])
+
+ // working our way backwards from the order of checks in sortProposalValue.Less()
+ // the test is tied to the implementation because it defines what the canonical order of checks is
+ sp[1].EncodingDigest[3] = byte('b')
+ require.Truef(t, sp.Less(0, 1), "expected %v < % v", sp[0], sp[1])
+ sp[0].BlockDigest[3] = byte('b')
+ require.Falsef(t, sp.Less(0, 1), "expected %v >= %v", sp[0], sp[1])
+ sp[1].BlockDigest[3] = byte('c')
+ require.Truef(t, sp.Less(0, 1), "expected %v < %v", sp[0], sp[1])
+ sp[0].OriginalProposer[3] = byte('b')
+ require.Falsef(t, sp.Less(0, 1), "expected %v >= %v", sp[0], sp[1])
+ sp[1].OriginalProposer[3] = byte('c')
+ require.Truef(t, sp.Less(0, 1), "expected %v < %v", sp[0], sp[1])
+ sp[0].OriginalPeriod = 2
+ require.Falsef(t, sp.Less(0, 1), "expected %v >= %v", sp[0], sp[1])
+}
diff --git a/agreement/voteAggregator.go b/agreement/voteAggregator.go
index 057f9d14f3..196e91a3bb 100644
--- a/agreement/voteAggregator.go
+++ b/agreement/voteAggregator.go
@@ -29,7 +29,9 @@ import (
// bundlePresent, and bundleVerified.
// It returns the following type(s) of event: none, vote{Filtered,Malformed},
// bundle{Filtered,Malformed}, and {soft,cert,next}Threshold.
-type voteAggregator struct{}
+type voteAggregator struct {
+ _struct struct{} `codec:","`
+}
func (agg *voteAggregator) T() stateMachineTag {
return voteMachine
diff --git a/agreement/voteAggregator_test.go b/agreement/voteAggregator_test.go
index f23bd4d564..8795a0b364 100644
--- a/agreement/voteAggregator_test.go
+++ b/agreement/voteAggregator_test.go
@@ -900,7 +900,7 @@ func TestVoteAggregatorOldVote(t *testing.T) {
results := make(chan asyncVerifyVoteResponse, len(uvs))
for i, uv := range uvs {
- avv.verifyVote(context.Background(), ledger, uv, i, message{}, results)
+ avv.verifyVote(context.Background(), ledger, uv, uint64(i), message{}, results)
result := <-results
require.True(t, result.cancelled)
}
diff --git a/agreement/voteAuxiliary.go b/agreement/voteAuxiliary.go
index 0c6e85c47e..d99a01139e 100644
--- a/agreement/voteAuxiliary.go
+++ b/agreement/voteAuxiliary.go
@@ -19,6 +19,7 @@ package agreement
// A voteTrackerPeriod is a voteMachinePeriod which indicates whether a
// next-threshold of votes was observed for a some value in a period.
type voteTrackerPeriod struct {
+ _struct struct{} `codec:","`
// Make it explicit that we are serializing player fields for crash recovery;
// we should probably adopt this convention over the rest of player at some point.
Cached nextThresholdStatusEvent
@@ -99,6 +100,7 @@ func (t *voteTrackerPeriod) handle(r routerHandle, p player, e event) event {
// It returns the following type(s) of event: none and
// {soft,cert,next}Threshold, and freshestBundle
type voteTrackerRound struct {
+ _struct struct{} `codec:","`
// Freshest holds the freshest thresholdEvent seen this round.
Freshest thresholdEvent
// Ok is set if any thresholdEvent has been seen.
diff --git a/agreement/voteTracker.go b/agreement/voteTracker.go
index d0f717abd7..3945840158 100644
--- a/agreement/voteTracker.go
+++ b/agreement/voteTracker.go
@@ -27,8 +27,10 @@ import (
)
type proposalVoteCounter struct {
+ _struct struct{} `codec:","`
+
Count uint64
- Votes map[basics.Address]vote
+ Votes map[basics.Address]vote `codec:"Votes,allocbound=-"`
}
// A voteTracker is a voteMachineStep which handles duplication and
@@ -40,20 +42,21 @@ type proposalVoteCounter struct {
// It returns the following type(s) of event: none and
// {soft,cert,next}Threshold.
type voteTracker struct {
+ _struct struct{} `codec:","`
// Voters holds the set of voters which have voted in the current step.
// It is used to track whether a voter has equivocated.
- Voters map[basics.Address]vote
+ Voters map[basics.Address]vote `codec:"Voters,allocbound=-"`
// Counts holds the weighted sum of the votes for a given proposal.
// it also hold the individual votes.
// preconditions :
// Any proposalValue in Counts is gurenteed to contain at least one vote
- Counts map[proposalValue]proposalVoteCounter
+ Counts map[proposalValue]proposalVoteCounter `codec:"Counts,allocbound=-"`
// Equivocators holds the set of voters which have already equivocated
// once. Future votes from these voters are dropped and not
// propagated.
- Equivocators map[basics.Address]equivocationVote
+ Equivocators map[basics.Address]equivocationVote `codec:"Equivocators,allocbound=-"`
// EquivocatorsCount holds the number of equivocating votes which count
// for any proposal-value.
diff --git a/agreement/voteTrackerContract.go b/agreement/voteTrackerContract.go
index ca90a74a88..ad1585e6d1 100644
--- a/agreement/voteTrackerContract.go
+++ b/agreement/voteTrackerContract.go
@@ -42,6 +42,8 @@ import (
// Trace properties
// - voteFilterRequest is idempotent
type voteTrackerContract struct {
+ _struct struct{} `codec:","`
+
Step step
StepOk bool
diff --git a/buildnumber.dat b/buildnumber.dat
index 0cfbf08886..573541ac97 100644
--- a/buildnumber.dat
+++ b/buildnumber.dat
@@ -1 +1 @@
-2
+0
diff --git a/catchup/ledgerFetcher.go b/catchup/ledgerFetcher.go
index fa965a1543..30c5ccb3b8 100644
--- a/catchup/ledgerFetcher.go
+++ b/catchup/ledgerFetcher.go
@@ -39,8 +39,8 @@ import (
var errNoLedgerForRound = errors.New("no ledger available for given round")
const (
- // maxCatchpointFileChunkSize is a rough estimate for the worst-case scenario we're going to have of all the accounts data per a single catchpoint file chunk.
- maxCatchpointFileChunkSize = ledger.BalancesPerCatchpointFileChunk * basics.MaxEncodedAccountDataSize
+ // maxCatchpointFileChunkSize is a rough estimate for the worst-case scenario we're going to have of all the accounts data per a single catchpoint file chunk and one account with max resources.
+ maxCatchpointFileChunkSize = ledger.BalancesPerCatchpointFileChunk*(ledger.MaxEncodedBaseAccountDataSize+ledger.MaxEncodedKVDataSize) + ledger.ResourcesPerCatchpointFileChunk*ledger.MaxEncodedBaseResourceDataSize
// defaultMinCatchpointFileDownloadBytesPerSecond defines the worst-case scenario download speed we expect to get while downloading a catchpoint file
defaultMinCatchpointFileDownloadBytesPerSecond = 20 * 1024
// catchpointFileStreamReadSize defines the number of bytes we would attempt to read at each iteration from the incoming http data stream
@@ -146,10 +146,12 @@ func (lf *ledgerFetcher) getPeerLedger(ctx context.Context, peer network.HTTPPee
"writing balances to disk took %d seconds, "+
"writing creatables to disk took %d seconds, "+
"writing hashes to disk took %d seconds, "+
+ "writing kv pairs to disk took %d seconds, "+
"total duration is %d seconds",
downloadProgress.BalancesWriteDuration/time.Second,
downloadProgress.CreatablesWriteDuration/time.Second,
downloadProgress.HashesWriteDuration/time.Second,
+ downloadProgress.KVWriteDuration/time.Second,
writeDuration/time.Second)
}
@@ -191,5 +193,5 @@ func (lf *ledgerFetcher) getPeerLedger(ctx context.Context, peer network.HTTPPee
}
func (lf *ledgerFetcher) processBalancesBlock(ctx context.Context, sectionName string, bytes []byte, downloadProgress *ledger.CatchpointCatchupAccessorProgress) error {
- return lf.accessor.ProgressStagingBalances(ctx, sectionName, bytes, downloadProgress)
+ return lf.accessor.ProcessStagingBalances(ctx, sectionName, bytes, downloadProgress)
}
diff --git a/cmd/catchpointdump/file.go b/cmd/catchpointdump/file.go
index d0e1816708..ec2a3ccd8e 100644
--- a/cmd/catchpointdump/file.go
+++ b/cmd/catchpointdump/file.go
@@ -21,6 +21,7 @@ import (
"bufio"
"context"
"database/sql"
+ "encoding/base64"
"encoding/json"
"fmt"
"io"
@@ -34,6 +35,7 @@ import (
"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/data/bookkeeping"
+ "github.com/algorand/go-algorand/data/transactions/logic"
"github.com/algorand/go-algorand/ledger"
"github.com/algorand/go-algorand/ledger/ledgercore"
"github.com/algorand/go-algorand/logging"
@@ -128,6 +130,10 @@ var fileCmd = &cobra.Command{
if err != nil {
reportErrorf("Unable to print account database : %v", err)
}
+ err = printKeyValueStore("./ledger.tracker.sqlite", outFile)
+ if err != nil {
+ reportErrorf("Unable to print key value store : %v", err)
+ }
}
},
}
@@ -176,7 +182,7 @@ func loadCatchpointIntoDatabase(ctx context.Context, catchupAccessor ledger.Catc
return fileHeader, err
}
}
- err = catchupAccessor.ProgressStagingBalances(ctx, header.Name, balancesBlockBytes, &downloadProgress)
+ err = catchupAccessor.ProcessStagingBalances(ctx, header.Name, balancesBlockBytes, &downloadProgress)
if err != nil {
return fileHeader, err
}
@@ -380,7 +386,65 @@ func printAccountsDatabase(databaseName string, fileHeader ledger.CatchpointFile
}
// increase the deadline warning to disable the warning message.
- db.ResetTransactionWarnDeadline(ctx, tx, time.Now().Add(5*time.Second))
+ _, _ = db.ResetTransactionWarnDeadline(ctx, tx, time.Now().Add(5*time.Second))
return err
})
}
+
+func printKeyValue(writer *bufio.Writer, key, value []byte) {
+ var pretty string
+ ai, rest, err := logic.SplitBoxKey(string(key))
+ if err == nil {
+ pretty = fmt.Sprintf("box(%d, %s)", ai, base64.StdEncoding.EncodeToString([]byte(rest)))
+ } else {
+ pretty = base64.StdEncoding.EncodeToString(key)
+ }
+
+ fmt.Fprintf(writer, "%s : %v\n", pretty, base64.StdEncoding.EncodeToString(value))
+}
+
+func printKeyValueStore(databaseName string, outFile *os.File) error {
+ fmt.Printf("\n")
+ printDumpingCatchpointProgressLine(0, 50, 0)
+ lastProgressUpdate := time.Now()
+ progress := uint64(0)
+ defer printDumpingCatchpointProgressLine(0, 0, 0)
+
+ fileWriter := bufio.NewWriterSize(outFile, 1024*1024)
+ defer fileWriter.Flush()
+
+ dbAccessor, err := db.MakeAccessor(databaseName, true, false)
+ if err != nil || dbAccessor.Handle == nil {
+ return err
+ }
+
+ return dbAccessor.Atomic(func(ctx context.Context, tx *sql.Tx) error {
+ var rowsCount int64
+ err := tx.QueryRow("SELECT count(*) from catchpointkvstore").Scan(&rowsCount)
+ if err != nil {
+ return err
+ }
+
+ // ordered to make dumps more "diffable"
+ rows, err := tx.Query("SELECT key, value FROM catchpointkvstore order by key")
+ if err != nil {
+ return err
+ }
+ defer rows.Close()
+ for rows.Next() {
+ progress++
+ var key []byte
+ var value []byte
+ err := rows.Scan(&key, &value)
+ if err != nil {
+ return err
+ }
+ printKeyValue(fileWriter, key, value)
+ if time.Since(lastProgressUpdate) > 50*time.Millisecond {
+ lastProgressUpdate = time.Now()
+ printDumpingCatchpointProgressLine(int(float64(progress)*50.0/float64(rowsCount)), 50, int64(progress))
+ }
+ }
+ return nil
+ })
+}
diff --git a/cmd/catchpointdump/net.go b/cmd/catchpointdump/net.go
index 9073ece66e..8c1b056af3 100644
--- a/cmd/catchpointdump/net.go
+++ b/cmd/catchpointdump/net.go
@@ -357,6 +357,11 @@ func loadAndDump(addr string, tarFile string, genesisInitState ledgercore.InitSt
if err != nil {
return err
}
+ err = printKeyValueStore("./ledger.tracker.sqlite", outFile)
+ if err != nil {
+ return err
+ }
+
}
return nil
}
diff --git a/cmd/dispenser/index.html.tpl b/cmd/dispenser/index.html.tpl
new file mode 100644
index 0000000000..ec53973b89
--- /dev/null
+++ b/cmd/dispenser/index.html.tpl
@@ -0,0 +1,80 @@
+
+
+ Algorand dispenser
+
+
+
+
+
+ Algorand dispenser
+
+
+
+
The dispensed Algos have no monetary value and should only be used to test applications.
+
This service is gracefully provided to enable development on the Algorand blockchain test networks.
+
Please do not abuse it by requesting more Algos than needed.
+
+
+
+
+
+
+ Status:
+
+
+