diff --git a/proto/x/nodes/nodes.proto b/proto/x/nodes/nodes.proto index 58ddf12bf..f68c65e0d 100755 --- a/proto/x/nodes/nodes.proto +++ b/proto/x/nodes/nodes.proto @@ -11,6 +11,9 @@ message ProtoValidator { option (gogoproto.goproto_stringer) = true; option (gogoproto.goproto_getters) = false; + // This option is to make the order of RewardDelegators deterministic + option (gogoproto.stable_marshaler) = true; + bytes Address = 1 [(gogoproto.casttype) = "github.com/pokt-network/pocket-core/types.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; bytes PublicKey = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; bool jailed = 3 [(gogoproto.jsontag) = "jailed"]; diff --git a/x/nodes/keeper/validator_test.go b/x/nodes/keeper/validator_test.go index befbb420d..6239d0857 100644 --- a/x/nodes/keeper/validator_test.go +++ b/x/nodes/keeper/validator_test.go @@ -1,10 +1,15 @@ package keeper import ( + "encoding/hex" "fmt" + "math/rand" "reflect" + "strconv" "testing" + "time" + "github.com/pokt-network/pocket-core/crypto" sdk "github.com/pokt-network/pocket-core/types" "github.com/pokt-network/pocket-core/x/nodes/types" "github.com/stretchr/testify/assert" @@ -150,6 +155,70 @@ func Test_sortNoLongerStakedValidators(t *testing.T) { } } +// Verifies the marshaled product of a validator is the same regardless of +// the order of RewardDelegators. If it is not, a key of the merkle tree in +// application.db is not deterministic, that will cause consensus failure. +func Test_Marshal_RewardDelegators(t *testing.T) { + numOfIterations := 100 + numOfDelegators := 100 + + chains := []string{"0001", "0002", "005A", "005B", "005C", "005D"} + url := "https://test.pokt.network:443" + stake := int64(18000000000) + pubKey, _ := crypto.NewPublicKey("0b787e54e66b3db3a3396c2322d8314287e08990f7696c490153b078bada7e94") + nodeAddr := sdk.Address(pubKey.PubKey().Address()) + outputAddr, _ := sdk.AddressFromHex("42846261e1798fc08e1dfd97325af7b280f815b0") + + // Generate a bunch of random numbers to use as reward delegator addressees + randNums := make([]int, numOfDelegators) + for j := 0; j < numOfDelegators; j++ { + randNums[j] = rand.Int() + } + + var valHash string + + for i := 0; i < numOfIterations; i++ { + // Initialize `delegatorMap` with a different order of the pre-created + // random numbers. In every iteration, the value of `delegatorMap` is the + // same, but the order of its range loop (`for k, v := range delegatorMap`) + // is usually impacted by the order of values inserted. + // This behavior is not guaranteed as https://go.dev/ref/spec#For_statements + // says "The iteration order over maps is not specified and is not + // guaranteed to be the same from one iteration to the next", but it's + // ok for testing purpose. + rand.Shuffle(len(randNums), func(i, j int) { + randNums[i], randNums[j] = randNums[j], randNums[i] + }) + delegatorMap := map[string]uint32{} + for randNum := range randNums { + delegatorMap[strconv.Itoa(randNum)] = uint32(randNum % 10) + } + + val := types.Validator{ + Address: nodeAddr, + PublicKey: pubKey, + Jailed: false, + Status: sdk.Staked, + Chains: chains, + UnstakingCompletionTime: time.Time{}, + ServiceURL: url, + StakedTokens: sdk.NewInt(stake), + OutputAddress: outputAddr, + RewardDelegators: delegatorMap, + } + valBytes, err := val.Marshal() + assert.Nil(t, err) + + // First test iteration when valhash hasn't been set yet + if len(valHash) == 0 { + valHash = hex.EncodeToString(valBytes) + } + + // Make sure the hash is always the same regardless of the order of randNums + assert.Equal(t, hex.EncodeToString(valBytes), valHash) + } +} + // There are two versions of structs to represent a validator. // - LegacyValidator - the original version // - Validator - LegacyValidator + OutputAddress + Delegators (since 0.11) diff --git a/x/nodes/types/nodes.pb.go b/x/nodes/types/nodes.pb.go index 33e729066..acd2ff2ee 100644 --- a/x/nodes/types/nodes.pb.go +++ b/x/nodes/types/nodes.pb.go @@ -7,6 +7,7 @@ import ( bytes "bytes" fmt "fmt" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_sortkeys "github.com/cosmos/gogoproto/sortkeys" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "github.com/gogo/protobuf/gogoproto" _ "github.com/golang/protobuf/ptypes/timestamp" @@ -52,16 +53,12 @@ func (m *ProtoValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ProtoValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoValidator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *ProtoValidator) XXX_Merge(src proto.Message) { xxx_messageInfo_ProtoValidator.Merge(m, src) @@ -217,61 +214,61 @@ func init() { func init() { proto.RegisterFile("x/nodes/nodes.proto", fileDescriptor_63cb49073b61e33a) } var fileDescriptor_63cb49073b61e33a = []byte{ - // 858 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x96, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0xc7, 0xc5, 0xc8, 0xb2, 0xac, 0x93, 0xe2, 0xa6, 0xb4, 0x8d, 0x12, 0x6e, 0xa1, 0x13, 0xd8, - 0xa1, 0x1a, 0x6a, 0xaa, 0x4d, 0x96, 0xd6, 0x45, 0x81, 0x86, 0x6e, 0x81, 0xba, 0x09, 0xd0, 0xe0, - 0x6c, 0x77, 0xc8, 0x42, 0x50, 0xe4, 0x89, 0xbe, 0xf0, 0xc7, 0x11, 0xbc, 0x63, 0x62, 0xfd, 0x07, - 0xed, 0xe6, 0xa9, 0xc8, 0xe8, 0x3f, 0x27, 0x63, 0x3a, 0x14, 0x28, 0x3a, 0x5c, 0x0b, 0x1b, 0x28, - 0x0a, 0x8e, 0x1a, 0x3b, 0x15, 0xbc, 0xa3, 0x22, 0xd1, 0x51, 0x8b, 0x20, 0xc8, 0x98, 0x45, 0xe4, - 0x7d, 0xdf, 0xbb, 0xf7, 0x7d, 0xc7, 0xfb, 0x3c, 0x40, 0x60, 0xeb, 0x6c, 0x94, 0x50, 0x1f, 0x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6, 0xeb, 0xf2, 0x1a, 0xee, 0xfc, 0x1b, 0x00, 0x00, - 0xff, 0xff, 0x49, 0xf4, 0x43, 0x35, 0x3f, 0x09, 0x00, 0x00, + // 864 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x96, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0x4d, 0xd3, 0x34, 0x93, 0x6c, 0x29, 0x6e, 0x2b, 0xac, 0x82, 0x32, 0x91, 0x39, + 0x90, 0x03, 0xb5, 0x61, 0xf7, 0x02, 0x41, 0x48, 0xac, 0x0b, 0x12, 0x65, 0x57, 0x62, 0x35, 0x6d, + 0x39, 0xec, 0xc5, 0x72, 0xec, 0x89, 0x3b, 0xeb, 0x1f, 0x63, 0xd9, 0xe3, 0xdd, 0xe6, 0x3f, 0x80, + 0x5b, 0x4f, 0xa8, 0xc7, 0xf2, 0xdf, 0xec, 0x71, 0x2f, 0x2b, 0x21, 0x0e, 0x03, 0x6a, 0x25, 0x84, + 0x7c, 0xcc, 0x91, 0x13, 0xf2, 0x8c, 0xb3, 0x89, 0x77, 0x03, 0x5a, 0xad, 0x38, 0xf6, 0x12, 0x7b, + 0xbe, 0xef, 0xcd, 0xfb, 0xbe, 0xf1, 0x7c, 0x9e, 0x14, 0xb0, 0x7d, 0x66, 0xc6, 0xd4, 0xc3, 0x99, + 0xfc, 0x35, 0x92, 0x94, 0x32, 0xaa, 0xb6, 0xcf, 0x0c, 0xb1, 0xdc, 0xdb, 0xf1, 0xa9, 0x4f, 0x85, + 0x66, 0x96, 0x6f, 0x32, 0xbc, 0x07, 0x7d, 0x4a, 0xfd, 0x10, 0x9b, 0x62, 0x35, 0xce, 0x27, 0x26, + 0x23, 0x11, 0xce, 0x98, 0x13, 0x25, 0x32, 0x41, 0x7f, 0xd1, 0x06, 0x9b, 0x0f, 0xcb, 0xb7, 0x1f, + 0x9c, 0x90,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, 0x23, 0xb9, 0x4b, 0x8d, 0x41, 0x4f, 0x42, 0x68, 0xe7, 0x31, 0x23, + 0xa1, 0x00, 0xf0, 0xbf, 0x6f, 0xc3, 0xac, 0x6e, 0xa3, 0xb6, 0x6f, 0xe1, 0xb2, 0xac, 0xca, 0x9b, + 0xe8, 0x4a, 0xe9, 0xa4, 0x54, 0xd4, 0x08, 0xec, 0x46, 0x24, 0xcb, 0xb0, 0x67, 0x8f, 0x43, 0xea, + 0x06, 0x99, 0xed, 0xd2, 0x3c, 0x66, 0x38, 0xd5, 0x5a, 0xa2, 0xfd, 0xcf, 0x0b, 0x0e, 0x57, 0x27, + 0xcc, 0x38, 0xfc, 0x40, 0x3a, 0xac, 0x0c, 0xeb, 0x68, 0x5b, 0xea, 0x96, 0x90, 0x0f, 0xa4, 0x5a, + 0xda, 0x55, 0x0d, 0xbd, 0x62, 0xb7, 0xbe, 0xb0, 0x5b, 0x99, 0xb0, 0xb0, 0x5b, 0x19, 0xd6, 0xd1, + 0xb6, 0xd4, 0x6b, 0x76, 0xa3, 0x8d, 0x8b, 0x4b, 0xd8, 0x28, 0xb9, 0xb2, 0xee, 0x3f, 0xbb, 0xea, + 0x2b, 0xcf, 0xaf, 0xfa, 0xca, 0x1f, 0x57, 0x7d, 0xe5, 0xfc, 0xba, 0xdf, 0x78, 0x7e, 0xdd, 0x6f, + 0xfc, 0x7a, 0xdd, 0x6f, 0x3c, 0x7a, 0x23, 0x70, 0xe6, 0xff, 0x95, 0x04, 0x40, 0xe3, 0x75, 0x71, + 0x0d, 0x77, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x65, 0x4f, 0x26, 0x43, 0x09, 0x00, 0x00, } func (this *ProtoValidator) Equal(that interface{}) bool { @@ -445,15 +442,20 @@ func (m *ProtoValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.RewardDelegators) > 0 { + keysForRewardDelegators := make([]string, 0, len(m.RewardDelegators)) for k := range m.RewardDelegators { - v := m.RewardDelegators[k] + keysForRewardDelegators = append(keysForRewardDelegators, string(k)) + } + github_com_cosmos_gogoproto_sortkeys.Strings(keysForRewardDelegators) + for iNdEx := len(keysForRewardDelegators) - 1; iNdEx >= 0; iNdEx-- { + v := m.RewardDelegators[string(keysForRewardDelegators[iNdEx])] baseI := i i = encodeVarintNodes(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintNodes(dAtA, i, uint64(len(k))) + i -= len(keysForRewardDelegators[iNdEx]) + copy(dAtA[i:], keysForRewardDelegators[iNdEx]) + i = encodeVarintNodes(dAtA, i, uint64(len(keysForRewardDelegators[iNdEx]))) i-- dAtA[i] = 0xa i = encodeVarintNodes(dAtA, i, uint64(baseI-i))