diff options
Diffstat (limited to 'data/bookkeeping/msgp_gen.go')
-rw-r--r-- | data/bookkeeping/msgp_gen.go | 922 |
1 files changed, 621 insertions, 301 deletions
diff --git a/data/bookkeeping/msgp_gen.go b/data/bookkeeping/msgp_gen.go index 8b88b8fbe..e7a810e3d 100644 --- a/data/bookkeeping/msgp_gen.go +++ b/data/bookkeeping/msgp_gen.go @@ -5,7 +5,9 @@ package bookkeeping import ( "sort" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" "github.com/algorand/msgp/msgp" ) @@ -59,6 +61,14 @@ import ( // |-----> (*) Msgsize // |-----> (*) MsgIsZero // +// ParticipationUpdates +// |-----> (*) MarshalMsg +// |-----> (*) CanMarshalMsg +// |-----> (*) UnmarshalMsg +// |-----> (*) CanUnmarshalMsg +// |-----> (*) Msgsize +// |-----> (*) MsgIsZero +// // RewardsState // |-----> (*) MarshalMsg // |-----> (*) CanMarshalMsg @@ -80,108 +90,112 @@ import ( func (z *Block) MarshalMsg(b []byte) (o []byte) { o = msgp.Require(b, z.Msgsize()) // omitempty: check for empty values - zb0003Len := uint32(24) - var zb0003Mask uint32 /* 27 bits */ + zb0004Len := uint32(25) + var zb0004Mask uint32 /* 29 bits */ if len((*z).BlockHeader.CompactCert) == 0 { - zb0003Len-- - zb0003Mask |= 0x8 + zb0004Len-- + zb0004Mask |= 0x10 } if (*z).BlockHeader.RewardsState.RewardsLevel == 0 { - zb0003Len-- - zb0003Mask |= 0x10 + zb0004Len-- + zb0004Mask |= 0x20 } if (*z).BlockHeader.RewardsState.FeeSink.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x20 + zb0004Len-- + zb0004Mask |= 0x40 } if (*z).BlockHeader.RewardsState.RewardsResidue == 0 { - zb0003Len-- - zb0003Mask |= 0x40 + zb0004Len-- + zb0004Mask |= 0x80 } if (*z).BlockHeader.GenesisID == "" { - zb0003Len-- - zb0003Mask |= 0x80 + zb0004Len-- + zb0004Mask |= 0x100 } if (*z).BlockHeader.GenesisHash.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x100 + zb0004Len-- + zb0004Mask |= 0x200 } if (*z).BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x200 + zb0004Len-- + zb0004Mask |= 0x400 } if (*z).BlockHeader.UpgradeState.NextProtocol.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x400 + zb0004Len-- + zb0004Mask |= 0x800 } if (*z).BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x800 + zb0004Len-- + zb0004Mask |= 0x1000 } if (*z).BlockHeader.UpgradeState.NextProtocolApprovals == 0 { - zb0003Len-- - zb0003Mask |= 0x1000 + zb0004Len-- + zb0004Mask |= 0x2000 + } + if len((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0 { + zb0004Len-- + zb0004Mask |= 0x4000 } if (*z).BlockHeader.Branch.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x2000 + zb0004Len-- + zb0004Mask |= 0x8000 } if (*z).BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x4000 + zb0004Len-- + zb0004Mask |= 0x10000 } if (*z).BlockHeader.RewardsState.RewardsRate == 0 { - zb0003Len-- - zb0003Mask |= 0x8000 + zb0004Len-- + zb0004Mask |= 0x20000 } if (*z).BlockHeader.Round.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x10000 + zb0004Len-- + zb0004Mask |= 0x40000 } if (*z).BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x20000 + zb0004Len-- + zb0004Mask |= 0x80000 } if (*z).BlockHeader.RewardsState.RewardsPool.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x40000 + zb0004Len-- + zb0004Mask |= 0x100000 } if (*z).BlockHeader.Seed.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x80000 + zb0004Len-- + zb0004Mask |= 0x200000 } if (*z).BlockHeader.TxnCounter == 0 { - zb0003Len-- - zb0003Mask |= 0x100000 + zb0004Len-- + zb0004Mask |= 0x400000 } if (*z).BlockHeader.TimeStamp == 0 { - zb0003Len-- - zb0003Mask |= 0x200000 + zb0004Len-- + zb0004Mask |= 0x800000 } if (*z).BlockHeader.TxnRoot.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x400000 + zb0004Len-- + zb0004Mask |= 0x1000000 } if (*z).Payset.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x800000 + zb0004Len-- + zb0004Mask |= 0x2000000 } if (*z).BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x1000000 + zb0004Len-- + zb0004Mask |= 0x4000000 } if (*z).BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x2000000 + zb0004Len-- + zb0004Mask |= 0x8000000 } if (*z).BlockHeader.UpgradeVote.UpgradeApprove == false { - zb0003Len-- - zb0003Mask |= 0x4000000 + zb0004Len-- + zb0004Mask |= 0x10000000 } - // variable map header, size zb0003Len - o = msgp.AppendMapHeader(o, zb0003Len) - if zb0003Len != 0 { - if (zb0003Mask & 0x8) == 0 { // if not empty + // variable map header, size zb0004Len + o = msgp.AppendMapHeader(o, zb0004Len) + if zb0004Len != 0 { + if (zb0004Mask & 0x10) == 0 { // if not empty // string "cc" o = append(o, 0xa2, 0x63, 0x63) if (*z).BlockHeader.CompactCert == nil { @@ -201,117 +215,129 @@ func (z *Block) MarshalMsg(b []byte) (o []byte) { o = zb0002.MarshalMsg(o) } } - if (zb0003Mask & 0x10) == 0 { // if not empty + if (zb0004Mask & 0x20) == 0 { // if not empty // string "earn" o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e) o = msgp.AppendUint64(o, (*z).BlockHeader.RewardsState.RewardsLevel) } - if (zb0003Mask & 0x20) == 0 { // if not empty + if (zb0004Mask & 0x40) == 0 { // if not empty // string "fees" o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73) o = (*z).BlockHeader.RewardsState.FeeSink.MarshalMsg(o) } - if (zb0003Mask & 0x40) == 0 { // if not empty + if (zb0004Mask & 0x80) == 0 { // if not empty // string "frac" o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63) o = msgp.AppendUint64(o, (*z).BlockHeader.RewardsState.RewardsResidue) } - if (zb0003Mask & 0x80) == 0 { // if not empty + if (zb0004Mask & 0x100) == 0 { // if not empty // string "gen" o = append(o, 0xa3, 0x67, 0x65, 0x6e) o = msgp.AppendString(o, (*z).BlockHeader.GenesisID) } - if (zb0003Mask & 0x100) == 0 { // if not empty + if (zb0004Mask & 0x200) == 0 { // if not empty // string "gh" o = append(o, 0xa2, 0x67, 0x68) o = (*z).BlockHeader.GenesisHash.MarshalMsg(o) } - if (zb0003Mask & 0x200) == 0 { // if not empty + if (zb0004Mask & 0x400) == 0 { // if not empty // string "nextbefore" o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65) o = (*z).BlockHeader.UpgradeState.NextProtocolVoteBefore.MarshalMsg(o) } - if (zb0003Mask & 0x400) == 0 { // if not empty + if (zb0004Mask & 0x800) == 0 { // if not empty // string "nextproto" o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f) o = (*z).BlockHeader.UpgradeState.NextProtocol.MarshalMsg(o) } - if (zb0003Mask & 0x800) == 0 { // if not empty + if (zb0004Mask & 0x1000) == 0 { // if not empty // string "nextswitch" o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68) o = (*z).BlockHeader.UpgradeState.NextProtocolSwitchOn.MarshalMsg(o) } - if (zb0003Mask & 0x1000) == 0 { // if not empty + if (zb0004Mask & 0x2000) == 0 { // if not empty // string "nextyes" o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73) o = msgp.AppendUint64(o, (*z).BlockHeader.UpgradeState.NextProtocolApprovals) } - if (zb0003Mask & 0x2000) == 0 { // if not empty + if (zb0004Mask & 0x4000) == 0 { // if not empty + // string "partupdrmv" + o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76) + if (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts == nil { + o = msgp.AppendNil(o) + } else { + o = msgp.AppendArrayHeader(o, uint32(len((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts))) + } + for zb0003 := range (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts { + o = (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o) + } + } + if (zb0004Mask & 0x8000) == 0 { // if not empty // string "prev" o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76) o = (*z).BlockHeader.Branch.MarshalMsg(o) } - if (zb0003Mask & 0x4000) == 0 { // if not empty + if (zb0004Mask & 0x10000) == 0 { // if not empty // string "proto" o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f) o = (*z).BlockHeader.UpgradeState.CurrentProtocol.MarshalMsg(o) } - if (zb0003Mask & 0x8000) == 0 { // if not empty + if (zb0004Mask & 0x20000) == 0 { // if not empty // string "rate" o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65) o = msgp.AppendUint64(o, (*z).BlockHeader.RewardsState.RewardsRate) } - if (zb0003Mask & 0x10000) == 0 { // if not empty + if (zb0004Mask & 0x40000) == 0 { // if not empty // string "rnd" o = append(o, 0xa3, 0x72, 0x6e, 0x64) o = (*z).BlockHeader.Round.MarshalMsg(o) } - if (zb0003Mask & 0x20000) == 0 { // if not empty + if (zb0004Mask & 0x80000) == 0 { // if not empty // string "rwcalr" o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72) o = (*z).BlockHeader.RewardsState.RewardsRecalculationRound.MarshalMsg(o) } - if (zb0003Mask & 0x40000) == 0 { // if not empty + if (zb0004Mask & 0x100000) == 0 { // if not empty // string "rwd" o = append(o, 0xa3, 0x72, 0x77, 0x64) o = (*z).BlockHeader.RewardsState.RewardsPool.MarshalMsg(o) } - if (zb0003Mask & 0x80000) == 0 { // if not empty + if (zb0004Mask & 0x200000) == 0 { // if not empty // string "seed" o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64) o = (*z).BlockHeader.Seed.MarshalMsg(o) } - if (zb0003Mask & 0x100000) == 0 { // if not empty + if (zb0004Mask & 0x400000) == 0 { // if not empty // string "tc" o = append(o, 0xa2, 0x74, 0x63) o = msgp.AppendUint64(o, (*z).BlockHeader.TxnCounter) } - if (zb0003Mask & 0x200000) == 0 { // if not empty + if (zb0004Mask & 0x800000) == 0 { // if not empty // string "ts" o = append(o, 0xa2, 0x74, 0x73) o = msgp.AppendInt64(o, (*z).BlockHeader.TimeStamp) } - if (zb0003Mask & 0x400000) == 0 { // if not empty + if (zb0004Mask & 0x1000000) == 0 { // if not empty // string "txn" o = append(o, 0xa3, 0x74, 0x78, 0x6e) o = (*z).BlockHeader.TxnRoot.MarshalMsg(o) } - if (zb0003Mask & 0x800000) == 0 { // if not empty + if (zb0004Mask & 0x2000000) == 0 { // if not empty // string "txns" o = append(o, 0xa4, 0x74, 0x78, 0x6e, 0x73) o = (*z).Payset.MarshalMsg(o) } - if (zb0003Mask & 0x1000000) == 0 { // if not empty + if (zb0004Mask & 0x4000000) == 0 { // if not empty // string "upgradedelay" o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79) o = (*z).BlockHeader.UpgradeVote.UpgradeDelay.MarshalMsg(o) } - if (zb0003Mask & 0x2000000) == 0 { // if not empty + if (zb0004Mask & 0x8000000) == 0 { // if not empty // string "upgradeprop" o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70) o = (*z).BlockHeader.UpgradeVote.UpgradePropose.MarshalMsg(o) } - if (zb0003Mask & 0x4000000) == 0 { // if not empty + if (zb0004Mask & 0x10000000) == 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).BlockHeader.UpgradeVote.UpgradeApprove) @@ -329,214 +355,214 @@ func (_ *Block) CanMarshalMsg(z interface{}) bool { func (z *Block) 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 zb0004 int + var zb0005 bool + zb0004, zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) if _, ok := err.(msgp.TypeError); ok { - zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts) if err != nil { err = msgp.WrapError(err) return } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.Round.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Round") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.Branch.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Branch") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.Seed.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Seed") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.TxnRoot.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "TxnRoot") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.TimeStamp, bts, err = msgp.ReadInt64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "TimeStamp") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.GenesisID, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "GenesisID") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.GenesisHash.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "GenesisHash") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.RewardsState.FeeSink.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "FeeSink") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.RewardsState.RewardsPool.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsPool") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsLevel") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsRate") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsResidue") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsRecalculationRound") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.UpgradeState.CurrentProtocol.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "CurrentProtocol") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.UpgradeState.NextProtocol.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocol") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocolApprovals") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocolVoteBefore") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocolSwitchOn") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.UpgradeVote.UpgradePropose.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "UpgradePropose") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).BlockHeader.UpgradeVote.UpgradeDelay.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "UpgradeDelay") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "UpgradeApprove") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).BlockHeader.TxnCounter, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "TxnCounter") return } } - if zb0003 > 0 { - zb0003-- - var zb0005 int - var zb0006 bool - zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + 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", "CompactCert") return } - if zb0005 > protocol.NumCompactCertTypes { - err = msgp.ErrOverflow(uint64(zb0005), uint64(protocol.NumCompactCertTypes)) + if zb0006 > protocol.NumCompactCertTypes { + err = msgp.ErrOverflow(uint64(zb0006), uint64(protocol.NumCompactCertTypes)) err = msgp.WrapError(err, "struct-from-array", "CompactCert") return } - if zb0006 { + if zb0007 { (*z).BlockHeader.CompactCert = nil } else if (*z).BlockHeader.CompactCert == nil { - (*z).BlockHeader.CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0005) + (*z).BlockHeader.CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0006) } - for zb0005 > 0 { + for zb0006 > 0 { var zb0001 protocol.CompactCertType var zb0002 CompactCertState - zb0005-- + zb0006-- bts, err = zb0001.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "CompactCert") @@ -550,16 +576,45 @@ func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) { (*z).BlockHeader.CompactCert[zb0001] = zb0002 } } - if zb0003 > 0 { - zb0003-- + 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).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil + } else if (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0008 { + (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0008] + } else { + (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0008) + } + for zb0003 := range (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts { + bts, err = (*z).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).Payset.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Payset") return } } - if zb0003 > 0 { - err = msgp.ErrTooManyArrayFields(zb0003) + if zb0004 > 0 { + err = msgp.ErrTooManyArrayFields(zb0004) if err != nil { err = msgp.WrapError(err, "struct-from-array") return @@ -570,11 +625,11 @@ func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) { err = msgp.WrapError(err) return } - if zb0004 { + if zb0005 { (*z) = Block{} } - for zb0003 > 0 { - zb0003-- + for zb0004 > 0 { + zb0004-- field, bts, err = msgp.ReadMapKeyZC(bts) if err != nil { err = msgp.WrapError(err) @@ -714,27 +769,27 @@ func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) { return } case "cc": - var zb0007 int - var zb0008 bool - zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts) + var zb0010 int + var zb0011 bool + zb0010, zb0011, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err, "CompactCert") return } - if zb0007 > protocol.NumCompactCertTypes { - err = msgp.ErrOverflow(uint64(zb0007), uint64(protocol.NumCompactCertTypes)) + if zb0010 > protocol.NumCompactCertTypes { + err = msgp.ErrOverflow(uint64(zb0010), uint64(protocol.NumCompactCertTypes)) err = msgp.WrapError(err, "CompactCert") return } - if zb0008 { + if zb0011 { (*z).BlockHeader.CompactCert = nil } else if (*z).BlockHeader.CompactCert == nil { - (*z).BlockHeader.CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0007) + (*z).BlockHeader.CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0010) } - for zb0007 > 0 { + for zb0010 > 0 { var zb0001 protocol.CompactCertType var zb0002 CompactCertState - zb0007-- + zb0010-- bts, err = zb0001.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "CompactCert") @@ -747,6 +802,33 @@ func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) { } (*z).BlockHeader.CompactCert[zb0001] = zb0002 } + case "partupdrmv": + var zb0012 int + var zb0013 bool + zb0012, zb0013, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExpiredParticipationAccounts") + return + } + if zb0012 > config.MaxProposedExpiredOnlineAccounts { + err = msgp.ErrOverflow(uint64(zb0012), uint64(config.MaxProposedExpiredOnlineAccounts)) + err = msgp.WrapError(err, "ExpiredParticipationAccounts") + return + } + if zb0013 { + (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = nil + } else if (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) >= zb0012 { + (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = ((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts)[:zb0012] + } else { + (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0012) + } + for zb0003 := range (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts { + bts, err = (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0003) + return + } + } case "txns": bts, err = (*z).Payset.UnmarshalMsg(bts) if err != nil { @@ -781,13 +863,17 @@ func (z *Block) Msgsize() (s int) { s += 0 + zb0001.Msgsize() + zb0002.Msgsize() } } + s += 11 + msgp.ArrayHeaderSize + for zb0003 := range (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts { + s += (*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize() + } s += 5 + (*z).Payset.Msgsize() return } // MsgIsZero returns whether this is a zero value func (z *Block) MsgIsZero() bool { - return ((*z).BlockHeader.Round.MsgIsZero()) && ((*z).BlockHeader.Branch.MsgIsZero()) && ((*z).BlockHeader.Seed.MsgIsZero()) && ((*z).BlockHeader.TxnRoot.MsgIsZero()) && ((*z).BlockHeader.TimeStamp == 0) && ((*z).BlockHeader.GenesisID == "") && ((*z).BlockHeader.GenesisHash.MsgIsZero()) && ((*z).BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).BlockHeader.RewardsState.RewardsRate == 0) && ((*z).BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).BlockHeader.TxnCounter == 0) && (len((*z).BlockHeader.CompactCert) == 0) && ((*z).Payset.MsgIsZero()) + return ((*z).BlockHeader.Round.MsgIsZero()) && ((*z).BlockHeader.Branch.MsgIsZero()) && ((*z).BlockHeader.Seed.MsgIsZero()) && ((*z).BlockHeader.TxnRoot.MsgIsZero()) && ((*z).BlockHeader.TimeStamp == 0) && ((*z).BlockHeader.GenesisID == "") && ((*z).BlockHeader.GenesisHash.MsgIsZero()) && ((*z).BlockHeader.RewardsState.FeeSink.MsgIsZero()) && ((*z).BlockHeader.RewardsState.RewardsPool.MsgIsZero()) && ((*z).BlockHeader.RewardsState.RewardsLevel == 0) && ((*z).BlockHeader.RewardsState.RewardsRate == 0) && ((*z).BlockHeader.RewardsState.RewardsResidue == 0) && ((*z).BlockHeader.RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.NextProtocol.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.NextProtocolApprovals == 0) && ((*z).BlockHeader.UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).BlockHeader.UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).BlockHeader.UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).BlockHeader.UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).BlockHeader.UpgradeVote.UpgradeApprove == false) && ((*z).BlockHeader.TxnCounter == 0) && (len((*z).BlockHeader.CompactCert) == 0) && (len((*z).BlockHeader.ParticipationUpdates.ExpiredParticipationAccounts) == 0) && ((*z).Payset.MsgIsZero()) } // MarshalMsg implements msgp.Marshaler @@ -822,104 +908,108 @@ func (z *BlockHash) MsgIsZero() bool { func (z *BlockHeader) MarshalMsg(b []byte) (o []byte) { o = msgp.Require(b, z.Msgsize()) // omitempty: check for empty values - zb0003Len := uint32(23) - var zb0003Mask uint32 /* 26 bits */ + zb0004Len := uint32(24) + var zb0004Mask uint32 /* 28 bits */ if len((*z).CompactCert) == 0 { - zb0003Len-- - zb0003Mask |= 0x8 + zb0004Len-- + zb0004Mask |= 0x10 } if (*z).RewardsState.RewardsLevel == 0 { - zb0003Len-- - zb0003Mask |= 0x10 + zb0004Len-- + zb0004Mask |= 0x20 } if (*z).RewardsState.FeeSink.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x20 + zb0004Len-- + zb0004Mask |= 0x40 } if (*z).RewardsState.RewardsResidue == 0 { - zb0003Len-- - zb0003Mask |= 0x40 + zb0004Len-- + zb0004Mask |= 0x80 } if (*z).GenesisID == "" { - zb0003Len-- - zb0003Mask |= 0x80 + zb0004Len-- + zb0004Mask |= 0x100 } if (*z).GenesisHash.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x100 + zb0004Len-- + zb0004Mask |= 0x200 } if (*z).UpgradeState.NextProtocolVoteBefore.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x200 + zb0004Len-- + zb0004Mask |= 0x400 } if (*z).UpgradeState.NextProtocol.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x400 + zb0004Len-- + zb0004Mask |= 0x800 } if (*z).UpgradeState.NextProtocolSwitchOn.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x800 + zb0004Len-- + zb0004Mask |= 0x1000 } if (*z).UpgradeState.NextProtocolApprovals == 0 { - zb0003Len-- - zb0003Mask |= 0x1000 + zb0004Len-- + zb0004Mask |= 0x2000 + } + if len((*z).ParticipationUpdates.ExpiredParticipationAccounts) == 0 { + zb0004Len-- + zb0004Mask |= 0x4000 } if (*z).Branch.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x2000 + zb0004Len-- + zb0004Mask |= 0x8000 } if (*z).UpgradeState.CurrentProtocol.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x4000 + zb0004Len-- + zb0004Mask |= 0x10000 } if (*z).RewardsState.RewardsRate == 0 { - zb0003Len-- - zb0003Mask |= 0x8000 + zb0004Len-- + zb0004Mask |= 0x20000 } if (*z).Round.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x10000 + zb0004Len-- + zb0004Mask |= 0x40000 } if (*z).RewardsState.RewardsRecalculationRound.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x20000 + zb0004Len-- + zb0004Mask |= 0x80000 } if (*z).RewardsState.RewardsPool.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x40000 + zb0004Len-- + zb0004Mask |= 0x100000 } if (*z).Seed.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x80000 + zb0004Len-- + zb0004Mask |= 0x200000 } if (*z).TxnCounter == 0 { - zb0003Len-- - zb0003Mask |= 0x100000 + zb0004Len-- + zb0004Mask |= 0x400000 } if (*z).TimeStamp == 0 { - zb0003Len-- - zb0003Mask |= 0x200000 + zb0004Len-- + zb0004Mask |= 0x800000 } if (*z).TxnRoot.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x400000 + zb0004Len-- + zb0004Mask |= 0x1000000 } if (*z).UpgradeVote.UpgradeDelay.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x800000 + zb0004Len-- + zb0004Mask |= 0x2000000 } if (*z).UpgradeVote.UpgradePropose.MsgIsZero() { - zb0003Len-- - zb0003Mask |= 0x1000000 + zb0004Len-- + zb0004Mask |= 0x4000000 } if (*z).UpgradeVote.UpgradeApprove == false { - zb0003Len-- - zb0003Mask |= 0x2000000 + zb0004Len-- + zb0004Mask |= 0x8000000 } - // variable map header, size zb0003Len - o = msgp.AppendMapHeader(o, zb0003Len) - if zb0003Len != 0 { - if (zb0003Mask & 0x8) == 0 { // if not empty + // variable map header, size zb0004Len + o = msgp.AppendMapHeader(o, zb0004Len) + if zb0004Len != 0 { + if (zb0004Mask & 0x10) == 0 { // if not empty // string "cc" o = append(o, 0xa2, 0x63, 0x63) if (*z).CompactCert == nil { @@ -939,112 +1029,124 @@ func (z *BlockHeader) MarshalMsg(b []byte) (o []byte) { o = zb0002.MarshalMsg(o) } } - if (zb0003Mask & 0x10) == 0 { // if not empty + if (zb0004Mask & 0x20) == 0 { // if not empty // string "earn" o = append(o, 0xa4, 0x65, 0x61, 0x72, 0x6e) o = msgp.AppendUint64(o, (*z).RewardsState.RewardsLevel) } - if (zb0003Mask & 0x20) == 0 { // if not empty + if (zb0004Mask & 0x40) == 0 { // if not empty // string "fees" o = append(o, 0xa4, 0x66, 0x65, 0x65, 0x73) o = (*z).RewardsState.FeeSink.MarshalMsg(o) } - if (zb0003Mask & 0x40) == 0 { // if not empty + if (zb0004Mask & 0x80) == 0 { // if not empty // string "frac" o = append(o, 0xa4, 0x66, 0x72, 0x61, 0x63) o = msgp.AppendUint64(o, (*z).RewardsState.RewardsResidue) } - if (zb0003Mask & 0x80) == 0 { // if not empty + if (zb0004Mask & 0x100) == 0 { // if not empty // string "gen" o = append(o, 0xa3, 0x67, 0x65, 0x6e) o = msgp.AppendString(o, (*z).GenesisID) } - if (zb0003Mask & 0x100) == 0 { // if not empty + if (zb0004Mask & 0x200) == 0 { // if not empty // string "gh" o = append(o, 0xa2, 0x67, 0x68) o = (*z).GenesisHash.MarshalMsg(o) } - if (zb0003Mask & 0x200) == 0 { // if not empty + if (zb0004Mask & 0x400) == 0 { // if not empty // string "nextbefore" o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65) o = (*z).UpgradeState.NextProtocolVoteBefore.MarshalMsg(o) } - if (zb0003Mask & 0x400) == 0 { // if not empty + if (zb0004Mask & 0x800) == 0 { // if not empty // string "nextproto" o = append(o, 0xa9, 0x6e, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f) o = (*z).UpgradeState.NextProtocol.MarshalMsg(o) } - if (zb0003Mask & 0x800) == 0 { // if not empty + if (zb0004Mask & 0x1000) == 0 { // if not empty // string "nextswitch" o = append(o, 0xaa, 0x6e, 0x65, 0x78, 0x74, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68) o = (*z).UpgradeState.NextProtocolSwitchOn.MarshalMsg(o) } - if (zb0003Mask & 0x1000) == 0 { // if not empty + if (zb0004Mask & 0x2000) == 0 { // if not empty // string "nextyes" o = append(o, 0xa7, 0x6e, 0x65, 0x78, 0x74, 0x79, 0x65, 0x73) o = msgp.AppendUint64(o, (*z).UpgradeState.NextProtocolApprovals) } - if (zb0003Mask & 0x2000) == 0 { // if not empty + if (zb0004Mask & 0x4000) == 0 { // if not empty + // string "partupdrmv" + o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76) + if (*z).ParticipationUpdates.ExpiredParticipationAccounts == nil { + o = msgp.AppendNil(o) + } else { + o = msgp.AppendArrayHeader(o, uint32(len((*z).ParticipationUpdates.ExpiredParticipationAccounts))) + } + for zb0003 := range (*z).ParticipationUpdates.ExpiredParticipationAccounts { + o = (*z).ParticipationUpdates.ExpiredParticipationAccounts[zb0003].MarshalMsg(o) + } + } + if (zb0004Mask & 0x8000) == 0 { // if not empty // string "prev" o = append(o, 0xa4, 0x70, 0x72, 0x65, 0x76) o = (*z).Branch.MarshalMsg(o) } - if (zb0003Mask & 0x4000) == 0 { // if not empty + if (zb0004Mask & 0x10000) == 0 { // if not empty // string "proto" o = append(o, 0xa5, 0x70, 0x72, 0x6f, 0x74, 0x6f) o = (*z).UpgradeState.CurrentProtocol.MarshalMsg(o) } - if (zb0003Mask & 0x8000) == 0 { // if not empty + if (zb0004Mask & 0x20000) == 0 { // if not empty // string "rate" o = append(o, 0xa4, 0x72, 0x61, 0x74, 0x65) o = msgp.AppendUint64(o, (*z).RewardsState.RewardsRate) } - if (zb0003Mask & 0x10000) == 0 { // if not empty + if (zb0004Mask & 0x40000) == 0 { // if not empty // string "rnd" o = append(o, 0xa3, 0x72, 0x6e, 0x64) o = (*z).Round.MarshalMsg(o) } - if (zb0003Mask & 0x20000) == 0 { // if not empty + if (zb0004Mask & 0x80000) == 0 { // if not empty // string "rwcalr" o = append(o, 0xa6, 0x72, 0x77, 0x63, 0x61, 0x6c, 0x72) o = (*z).RewardsState.RewardsRecalculationRound.MarshalMsg(o) } - if (zb0003Mask & 0x40000) == 0 { // if not empty + if (zb0004Mask & 0x100000) == 0 { // if not empty // string "rwd" o = append(o, 0xa3, 0x72, 0x77, 0x64) o = (*z).RewardsState.RewardsPool.MarshalMsg(o) } - if (zb0003Mask & 0x80000) == 0 { // if not empty + if (zb0004Mask & 0x200000) == 0 { // if not empty // string "seed" o = append(o, 0xa4, 0x73, 0x65, 0x65, 0x64) o = (*z).Seed.MarshalMsg(o) } - if (zb0003Mask & 0x100000) == 0 { // if not empty + if (zb0004Mask & 0x400000) == 0 { // if not empty // string "tc" o = append(o, 0xa2, 0x74, 0x63) o = msgp.AppendUint64(o, (*z).TxnCounter) } - if (zb0003Mask & 0x200000) == 0 { // if not empty + if (zb0004Mask & 0x800000) == 0 { // if not empty // string "ts" o = append(o, 0xa2, 0x74, 0x73) o = msgp.AppendInt64(o, (*z).TimeStamp) } - if (zb0003Mask & 0x400000) == 0 { // if not empty + if (zb0004Mask & 0x1000000) == 0 { // if not empty // string "txn" o = append(o, 0xa3, 0x74, 0x78, 0x6e) o = (*z).TxnRoot.MarshalMsg(o) } - if (zb0003Mask & 0x800000) == 0 { // if not empty + if (zb0004Mask & 0x2000000) == 0 { // if not empty // string "upgradedelay" o = append(o, 0xac, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x65, 0x6c, 0x61, 0x79) o = (*z).UpgradeVote.UpgradeDelay.MarshalMsg(o) } - if (zb0003Mask & 0x1000000) == 0 { // if not empty + if (zb0004Mask & 0x4000000) == 0 { // if not empty // string "upgradeprop" o = append(o, 0xab, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x70, 0x72, 0x6f, 0x70) o = (*z).UpgradeVote.UpgradePropose.MarshalMsg(o) } - if (zb0003Mask & 0x2000000) == 0 { // if not empty + if (zb0004Mask & 0x8000000) == 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).UpgradeVote.UpgradeApprove) @@ -1062,214 +1164,214 @@ func (_ *BlockHeader) CanMarshalMsg(z interface{}) bool { func (z *BlockHeader) 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 zb0004 int + var zb0005 bool + zb0004, zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) if _, ok := err.(msgp.TypeError); ok { - zb0003, zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts) if err != nil { err = msgp.WrapError(err) return } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).Round.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Round") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).Branch.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Branch") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).Seed.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "Seed") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).TxnRoot.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "TxnRoot") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).TimeStamp, bts, err = msgp.ReadInt64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "TimeStamp") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).GenesisID, bts, err = msgp.ReadStringBytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "GenesisID") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).GenesisHash.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "GenesisHash") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).RewardsState.FeeSink.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "FeeSink") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).RewardsState.RewardsPool.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsPool") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).RewardsState.RewardsLevel, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsLevel") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).RewardsState.RewardsRate, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsRate") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).RewardsState.RewardsResidue, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsResidue") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).RewardsState.RewardsRecalculationRound.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "RewardsRecalculationRound") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).UpgradeState.CurrentProtocol.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "CurrentProtocol") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).UpgradeState.NextProtocol.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocol") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).UpgradeState.NextProtocolApprovals, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocolApprovals") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).UpgradeState.NextProtocolVoteBefore.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocolVoteBefore") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).UpgradeState.NextProtocolSwitchOn.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "NextProtocolSwitchOn") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).UpgradeVote.UpgradePropose.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "UpgradePropose") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- bts, err = (*z).UpgradeVote.UpgradeDelay.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "UpgradeDelay") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).UpgradeVote.UpgradeApprove, bts, err = msgp.ReadBoolBytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "UpgradeApprove") return } } - if zb0003 > 0 { - zb0003-- + if zb0004 > 0 { + zb0004-- (*z).TxnCounter, bts, err = msgp.ReadUint64Bytes(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "TxnCounter") return } } - if zb0003 > 0 { - zb0003-- - var zb0005 int - var zb0006 bool - zb0005, zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + 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", "CompactCert") return } - if zb0005 > protocol.NumCompactCertTypes { - err = msgp.ErrOverflow(uint64(zb0005), uint64(protocol.NumCompactCertTypes)) + if zb0006 > protocol.NumCompactCertTypes { + err = msgp.ErrOverflow(uint64(zb0006), uint64(protocol.NumCompactCertTypes)) err = msgp.WrapError(err, "struct-from-array", "CompactCert") return } - if zb0006 { + if zb0007 { (*z).CompactCert = nil } else if (*z).CompactCert == nil { - (*z).CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0005) + (*z).CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0006) } - for zb0005 > 0 { + for zb0006 > 0 { var zb0001 protocol.CompactCertType var zb0002 CompactCertState - zb0005-- + zb0006-- bts, err = zb0001.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "struct-from-array", "CompactCert") @@ -1283,8 +1385,37 @@ func (z *BlockHeader) UnmarshalMsg(bts []byte) (o []byte, err error) { (*z).CompactCert[zb0001] = zb0002 } } - if zb0003 > 0 { - err = msgp.ErrTooManyArrayFields(zb0003) + 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).ParticipationUpdates.ExpiredParticipationAccounts = nil + } else if (*z).ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).ParticipationUpdates.ExpiredParticipationAccounts) >= zb0008 { + (*z).ParticipationUpdates.ExpiredParticipationAccounts = ((*z).ParticipationUpdates.ExpiredParticipationAccounts)[:zb0008] + } else { + (*z).ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0008) + } + for zb0003 := range (*z).ParticipationUpdates.ExpiredParticipationAccounts { + bts, err = (*z).ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts", zb0003) + return + } + } + } + if zb0004 > 0 { + err = msgp.ErrTooManyArrayFields(zb0004) if err != nil { err = msgp.WrapError(err, "struct-from-array") return @@ -1295,11 +1426,11 @@ func (z *BlockHeader) UnmarshalMsg(bts []byte) (o []byte, err error) { err = msgp.WrapError(err) return } - if zb0004 { + if zb0005 { (*z) = BlockHeader{} } - for zb0003 > 0 { - zb0003-- + for zb0004 > 0 { + zb0004-- field, bts, err = msgp.ReadMapKeyZC(bts) if err != nil { err = msgp.WrapError(err) @@ -1439,27 +1570,27 @@ func (z *BlockHeader) UnmarshalMsg(bts []byte) (o []byte, err error) { return } case "cc": - var zb0007 int - var zb0008 bool - zb0007, zb0008, bts, err = msgp.ReadMapHeaderBytes(bts) + var zb0010 int + var zb0011 bool + zb0010, zb0011, bts, err = msgp.ReadMapHeaderBytes(bts) if err != nil { err = msgp.WrapError(err, "CompactCert") return } - if zb0007 > protocol.NumCompactCertTypes { - err = msgp.ErrOverflow(uint64(zb0007), uint64(protocol.NumCompactCertTypes)) + if zb0010 > protocol.NumCompactCertTypes { + err = msgp.ErrOverflow(uint64(zb0010), uint64(protocol.NumCompactCertTypes)) err = msgp.WrapError(err, "CompactCert") return } - if zb0008 { + if zb0011 { (*z).CompactCert = nil } else if (*z).CompactCert == nil { - (*z).CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0007) + (*z).CompactCert = make(map[protocol.CompactCertType]CompactCertState, zb0010) } - for zb0007 > 0 { + for zb0010 > 0 { var zb0001 protocol.CompactCertType var zb0002 CompactCertState - zb0007-- + zb0010-- bts, err = zb0001.UnmarshalMsg(bts) if err != nil { err = msgp.WrapError(err, "CompactCert") @@ -1472,6 +1603,33 @@ func (z *BlockHeader) UnmarshalMsg(bts []byte) (o []byte, err error) { } (*z).CompactCert[zb0001] = zb0002 } + case "partupdrmv": + var zb0012 int + var zb0013 bool + zb0012, zb0013, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExpiredParticipationAccounts") + return + } + if zb0012 > config.MaxProposedExpiredOnlineAccounts { + err = msgp.ErrOverflow(uint64(zb0012), uint64(config.MaxProposedExpiredOnlineAccounts)) + err = msgp.WrapError(err, "ExpiredParticipationAccounts") + return + } + if zb0013 { + (*z).ParticipationUpdates.ExpiredParticipationAccounts = nil + } else if (*z).ParticipationUpdates.ExpiredParticipationAccounts != nil && cap((*z).ParticipationUpdates.ExpiredParticipationAccounts) >= zb0012 { + (*z).ParticipationUpdates.ExpiredParticipationAccounts = ((*z).ParticipationUpdates.ExpiredParticipationAccounts)[:zb0012] + } else { + (*z).ParticipationUpdates.ExpiredParticipationAccounts = make([]basics.Address, zb0012) + } + for zb0003 := range (*z).ParticipationUpdates.ExpiredParticipationAccounts { + bts, err = (*z).ParticipationUpdates.ExpiredParticipationAccounts[zb0003].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0003) + return + } + } default: err = msgp.ErrNoField(string(field)) if err != nil { @@ -1500,12 +1658,16 @@ func (z *BlockHeader) Msgsize() (s int) { s += 0 + zb0001.Msgsize() + zb0002.Msgsize() } } + s += 11 + msgp.ArrayHeaderSize + for zb0003 := range (*z).ParticipationUpdates.ExpiredParticipationAccounts { + s += (*z).ParticipationUpdates.ExpiredParticipationAccounts[zb0003].Msgsize() + } return } // MsgIsZero returns whether this is a zero value func (z *BlockHeader) MsgIsZero() bool { - return ((*z).Round.MsgIsZero()) && ((*z).Branch.MsgIsZero()) && ((*z).Seed.MsgIsZero()) && ((*z).TxnRoot.MsgIsZero()) && ((*z).TimeStamp == 0) && ((*z).GenesisID == "") && ((*z).GenesisHash.MsgIsZero()) && ((*z).RewardsState.FeeSink.MsgIsZero()) && ((*z).RewardsState.RewardsPool.MsgIsZero()) && ((*z).RewardsState.RewardsLevel == 0) && ((*z).RewardsState.RewardsRate == 0) && ((*z).RewardsState.RewardsResidue == 0) && ((*z).RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).UpgradeState.NextProtocol.MsgIsZero()) && ((*z).UpgradeState.NextProtocolApprovals == 0) && ((*z).UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).UpgradeVote.UpgradeApprove == false) && ((*z).TxnCounter == 0) && (len((*z).CompactCert) == 0) + return ((*z).Round.MsgIsZero()) && ((*z).Branch.MsgIsZero()) && ((*z).Seed.MsgIsZero()) && ((*z).TxnRoot.MsgIsZero()) && ((*z).TimeStamp == 0) && ((*z).GenesisID == "") && ((*z).GenesisHash.MsgIsZero()) && ((*z).RewardsState.FeeSink.MsgIsZero()) && ((*z).RewardsState.RewardsPool.MsgIsZero()) && ((*z).RewardsState.RewardsLevel == 0) && ((*z).RewardsState.RewardsRate == 0) && ((*z).RewardsState.RewardsResidue == 0) && ((*z).RewardsState.RewardsRecalculationRound.MsgIsZero()) && ((*z).UpgradeState.CurrentProtocol.MsgIsZero()) && ((*z).UpgradeState.NextProtocol.MsgIsZero()) && ((*z).UpgradeState.NextProtocolApprovals == 0) && ((*z).UpgradeState.NextProtocolVoteBefore.MsgIsZero()) && ((*z).UpgradeState.NextProtocolSwitchOn.MsgIsZero()) && ((*z).UpgradeVote.UpgradePropose.MsgIsZero()) && ((*z).UpgradeVote.UpgradeDelay.MsgIsZero()) && ((*z).UpgradeVote.UpgradeApprove == false) && ((*z).TxnCounter == 0) && (len((*z).CompactCert) == 0) && (len((*z).ParticipationUpdates.ExpiredParticipationAccounts) == 0) } // MarshalMsg implements msgp.Marshaler @@ -2132,6 +2294,164 @@ func (z *GenesisAllocation) MsgIsZero() bool { } // MarshalMsg implements msgp.Marshaler +func (z *ParticipationUpdates) MarshalMsg(b []byte) (o []byte) { + o = msgp.Require(b, z.Msgsize()) + // omitempty: check for empty values + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 2 bits */ + if len((*z).ExpiredParticipationAccounts) == 0 { + zb0002Len-- + zb0002Mask |= 0x2 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + if zb0002Len != 0 { + if (zb0002Mask & 0x2) == 0 { // if not empty + // string "partupdrmv" + o = append(o, 0xaa, 0x70, 0x61, 0x72, 0x74, 0x75, 0x70, 0x64, 0x72, 0x6d, 0x76) + if (*z).ExpiredParticipationAccounts == nil { + o = msgp.AppendNil(o) + } else { + o = msgp.AppendArrayHeader(o, uint32(len((*z).ExpiredParticipationAccounts))) + } + for zb0001 := range (*z).ExpiredParticipationAccounts { + o = (*z).ExpiredParticipationAccounts[zb0001].MarshalMsg(o) + } + } + } + return +} + +func (_ *ParticipationUpdates) CanMarshalMsg(z interface{}) bool { + _, ok := (z).(*ParticipationUpdates) + return ok +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ParticipationUpdates) 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-- + var zb0004 int + var zb0005 bool + zb0004, zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts") + return + } + if zb0004 > config.MaxProposedExpiredOnlineAccounts { + err = msgp.ErrOverflow(uint64(zb0004), uint64(config.MaxProposedExpiredOnlineAccounts)) + err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts") + return + } + if zb0005 { + (*z).ExpiredParticipationAccounts = nil + } else if (*z).ExpiredParticipationAccounts != nil && cap((*z).ExpiredParticipationAccounts) >= zb0004 { + (*z).ExpiredParticipationAccounts = ((*z).ExpiredParticipationAccounts)[:zb0004] + } else { + (*z).ExpiredParticipationAccounts = make([]basics.Address, zb0004) + } + for zb0001 := range (*z).ExpiredParticipationAccounts { + bts, err = (*z).ExpiredParticipationAccounts[zb0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "struct-from-array", "ExpiredParticipationAccounts", zb0001) + return + } + } + } + if zb0002 > 0 { + err = msgp.ErrTooManyArrayFields(zb0002) + if err != nil { + err = msgp.WrapError(err, "struct-from-array") + return + } + } + } else { + if err != nil { + err = msgp.WrapError(err) + return + } + if zb0003 { + (*z) = ParticipationUpdates{} + } + for zb0002 > 0 { + zb0002-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch string(field) { + case "partupdrmv": + var zb0006 int + var zb0007 bool + zb0006, zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ExpiredParticipationAccounts") + return + } + if zb0006 > config.MaxProposedExpiredOnlineAccounts { + err = msgp.ErrOverflow(uint64(zb0006), uint64(config.MaxProposedExpiredOnlineAccounts)) + err = msgp.WrapError(err, "ExpiredParticipationAccounts") + return + } + if zb0007 { + (*z).ExpiredParticipationAccounts = nil + } else if (*z).ExpiredParticipationAccounts != nil && cap((*z).ExpiredParticipationAccounts) >= zb0006 { + (*z).ExpiredParticipationAccounts = ((*z).ExpiredParticipationAccounts)[:zb0006] + } else { + (*z).ExpiredParticipationAccounts = make([]basics.Address, zb0006) + } + for zb0001 := range (*z).ExpiredParticipationAccounts { + bts, err = (*z).ExpiredParticipationAccounts[zb0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ExpiredParticipationAccounts", zb0001) + return + } + } + default: + err = msgp.ErrNoField(string(field)) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + } + o = bts + return +} + +func (_ *ParticipationUpdates) CanUnmarshalMsg(z interface{}) bool { + _, ok := (z).(*ParticipationUpdates) + return ok +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ParticipationUpdates) Msgsize() (s int) { + s = 1 + 11 + msgp.ArrayHeaderSize + for zb0001 := range (*z).ExpiredParticipationAccounts { + s += (*z).ExpiredParticipationAccounts[zb0001].Msgsize() + } + return +} + +// MsgIsZero returns whether this is a zero value +func (z *ParticipationUpdates) MsgIsZero() bool { + return (len((*z).ExpiredParticipationAccounts) == 0) +} + +// MarshalMsg implements msgp.Marshaler func (z *RewardsState) MarshalMsg(b []byte) (o []byte) { o = msgp.Require(b, z.Msgsize()) // omitempty: check for empty values |