From 451c950e63b5c2174e8dd23934d474da98fbc901 Mon Sep 17 00:00:00 2001 From: Manav Aggarwal Date: Thu, 11 May 2023 13:44:28 -0400 Subject: [PATCH] Remove Evidence while keeping ABCI compatibility. (#915) Removes Evidence from Block struct. Comments out relevant code lines with: ```// Note: Temporarily remove Evidence #896``` for adding back in the future when needed. Closes: #896 --------- Co-authored-by: Ganesha Upadhyaya --- proto/rollkit/rollkit.proto | 1 - state/executor.go | 3 +- types/block.go | 3 +- types/pb/rollkit/rollkit.pb.go | 152 ++++++++++----------------------- types/serialization.go | 42 ++++----- types/serialization_test.go | 3 +- 6 files changed, 72 insertions(+), 132 deletions(-) diff --git a/proto/rollkit/rollkit.proto b/proto/rollkit/rollkit.proto index 22ff7d1b23a..83b6cf10687 100644 --- a/proto/rollkit/rollkit.proto +++ b/proto/rollkit/rollkit.proto @@ -70,7 +70,6 @@ message SignedHeader { message Data { repeated bytes txs = 1; repeated bytes intermediate_state_roots = 2; - repeated tendermint.abci.Evidence evidence = 3; } message Block { diff --git a/state/executor.go b/state/executor.go index d668dd94331..cb7062cb15c 100644 --- a/state/executor.go +++ b/state/executor.go @@ -125,7 +125,8 @@ func (e *BlockExecutor) CreateBlock(height uint64, lastCommit *types.Commit, las Data: types.Data{ Txs: toRollkitTxs(mempoolTxs), IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, - Evidence: types.EvidenceData{Evidence: nil}, + // Note: Temporarily remove Evidence #896 + // Evidence: types.EvidenceData{Evidence: nil}, }, } block.SignedHeader.Header.LastCommitHash = e.getLastCommitHash(lastCommit, &block.SignedHeader.Header) diff --git a/types/block.go b/types/block.go index e9d57ae000b..c85a41d457d 100644 --- a/types/block.go +++ b/types/block.go @@ -30,7 +30,8 @@ var _ encoding.BinaryUnmarshaler = &Block{} type Data struct { Txs Txs IntermediateStateRoots IntermediateStateRoots - Evidence EvidenceData + // Note: Temporarily remove Evidence #896 + // Evidence EvidenceData } // EvidenceData defines how evidence is stored in block. diff --git a/types/pb/rollkit/rollkit.pb.go b/types/pb/rollkit/rollkit.pb.go index b4325f18d13..e68dc4c8bb2 100644 --- a/types/pb/rollkit/rollkit.pb.go +++ b/types/pb/rollkit/rollkit.pb.go @@ -6,7 +6,7 @@ package rollkit import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" - types1 "github.com/tendermint/tendermint/abci/types" + _ "github.com/tendermint/tendermint/abci/types" types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" @@ -335,9 +335,8 @@ func (m *SignedHeader) GetValidators() *types.ValidatorSet { } type Data struct { - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` - IntermediateStateRoots [][]byte `protobuf:"bytes,2,rep,name=intermediate_state_roots,json=intermediateStateRoots,proto3" json:"intermediate_state_roots,omitempty"` - Evidence []*types1.Evidence `protobuf:"bytes,3,rep,name=evidence,proto3" json:"evidence,omitempty"` + Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + IntermediateStateRoots [][]byte `protobuf:"bytes,2,rep,name=intermediate_state_roots,json=intermediateStateRoots,proto3" json:"intermediate_state_roots,omitempty"` } func (m *Data) Reset() { *m = Data{} } @@ -387,13 +386,6 @@ func (m *Data) GetIntermediateStateRoots() [][]byte { return nil } -func (m *Data) GetEvidence() []*types1.Evidence { - if m != nil { - return m.Evidence - } - return nil -} - type Block struct { SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -519,49 +511,47 @@ func init() { func init() { proto.RegisterFile("rollkit/rollkit.proto", fileDescriptor_ed489fb7f4d78b3f) } var fileDescriptor_ed489fb7f4d78b3f = []byte{ - // 664 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x94, 0xcf, 0x6a, 0xdb, 0x4a, - 0x14, 0xc6, 0x23, 0xdb, 0xb1, 0x9d, 0x63, 0x27, 0xf1, 0x1d, 0x6e, 0x72, 0x95, 0x04, 0x84, 0xaf, - 0xe1, 0x72, 0xdd, 0x14, 0x6c, 0x9a, 0x52, 0x28, 0x5d, 0x14, 0x9a, 0x36, 0x10, 0xef, 0xca, 0xb8, - 0xa4, 0xd0, 0x8d, 0x18, 0x4b, 0x53, 0x69, 0x88, 0xad, 0x19, 0x66, 0xc6, 0xc1, 0x7d, 0x84, 0xee, - 0xfa, 0x08, 0x7d, 0x84, 0x3e, 0x46, 0x97, 0x59, 0x76, 0x59, 0x92, 0x17, 0x29, 0xf3, 0x47, 0x8a, - 0xda, 0x8d, 0x3d, 0xe7, 0xfb, 0x7e, 0x73, 0x66, 0x74, 0xce, 0x91, 0xe0, 0x40, 0xf2, 0xe5, 0xf2, - 0x9a, 0xe9, 0xa9, 0xff, 0x9f, 0x08, 0xc9, 0x35, 0x47, 0x1d, 0x1f, 0x1e, 0x9f, 0x68, 0x5a, 0xa4, - 0x54, 0xae, 0x58, 0xa1, 0xa7, 0x64, 0x91, 0xb0, 0xa9, 0xfe, 0x24, 0xa8, 0x72, 0xd4, 0xf1, 0xb0, - 0x66, 0x5a, 0x7d, 0x7a, 0x43, 0x96, 0x2c, 0x25, 0x9a, 0x4b, 0x47, 0x8c, 0x9e, 0x40, 0xe7, 0x8a, - 0x4a, 0xc5, 0x78, 0x81, 0xfe, 0x86, 0xed, 0xc5, 0x92, 0x27, 0xd7, 0x61, 0x30, 0x0c, 0xc6, 0x2d, - 0xec, 0x02, 0x34, 0x80, 0x26, 0x11, 0x22, 0x6c, 0x58, 0xcd, 0x2c, 0x47, 0xdf, 0x9a, 0xd0, 0xbe, - 0xa4, 0x24, 0xa5, 0x12, 0x9d, 0x42, 0xe7, 0xc6, 0xed, 0xb6, 0x9b, 0x7a, 0x67, 0x83, 0x49, 0x79, - 0x4d, 0x9f, 0x15, 0x97, 0x00, 0x3a, 0x84, 0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x3f, 0xd0, 0x11, 0x92, 0xc6, 0x4c, 0xb9, 0x63, 0xfa, 0xb8, 0x2d, 0x24, - 0x9d, 0x29, 0x89, 0xf6, 0xa0, 0xa1, 0x37, 0x36, 0x4f, 0x1f, 0x37, 0xf4, 0xc6, 0x8c, 0x84, 0xe0, - 0x4a, 0x5b, 0xb2, 0xe9, 0xe6, 0xd5, 0xc4, 0x33, 0x25, 0xcf, 0x2f, 0xbe, 0xdf, 0x45, 0xc1, 0xed, - 0x5d, 0x14, 0xfc, 0xbc, 0x8b, 0x82, 0x2f, 0xf7, 0xd1, 0xd6, 0xed, 0x7d, 0xb4, 0xf5, 0xe3, 0x3e, - 0xda, 0xfa, 0xf0, 0x38, 0x63, 0x3a, 0x5f, 0x2f, 0x26, 0x09, 0x5f, 0x4d, 0xff, 0xf8, 0xf8, 0xf8, - 0x8f, 0x88, 0x58, 0x94, 0xc2, 0xa2, 0x6d, 0x3f, 0x23, 0x4f, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, - 0x66, 0x93, 0xdd, 0xfe, 0xa7, 0x04, 0x00, 0x00, + // 632 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x94, 0xd1, 0x6e, 0xd3, 0x3c, + 0x14, 0xc7, 0x97, 0xb6, 0x6b, 0xb6, 0xb3, 0x6c, 0xeb, 0x17, 0x7d, 0x1b, 0x61, 0x93, 0xa2, 0x12, + 0x09, 0x51, 0x86, 0xd4, 0x8a, 0x71, 0x83, 0xb8, 0x40, 0x62, 0x80, 0xb4, 0xde, 0x21, 0x17, 0x0d, + 0x89, 0x9b, 0xc8, 0x6d, 0x4c, 0x62, 0xad, 0x8d, 0x2d, 0xdb, 0x9d, 0xca, 0x5b, 0xf0, 0x08, 0x3c, + 0x02, 0x8f, 0xc1, 0xe5, 0x2e, 0xb9, 0x44, 0xeb, 0x8b, 0x20, 0x1f, 0x27, 0x5d, 0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 0xb5, 0x85, 0x7b, 0x6f, 0x04, 0x00, 0x00, } func (m *Version) Marshal() (dAtA []byte, err error) { @@ -816,20 +806,6 @@ func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Evidence) > 0 { - for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRollkit(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } if len(m.IntermediateStateRoots) > 0 { for iNdEx := len(m.IntermediateStateRoots) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.IntermediateStateRoots[iNdEx]) @@ -1077,12 +1053,6 @@ func (m *Data) Size() (n int) { n += 1 + l + sovRollkit(uint64(l)) } } - if len(m.Evidence) > 0 { - for _, e := range m.Evidence { - l = e.Size() - n += 1 + l + sovRollkit(uint64(l)) - } - } return n } @@ -1979,40 +1949,6 @@ func (m *Data) Unmarshal(dAtA []byte) error { m.IntermediateStateRoots = append(m.IntermediateStateRoots, make([]byte, postIndex-iNdEx)) copy(m.IntermediateStateRoots[len(m.IntermediateStateRoots)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRollkit - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRollkit - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRollkit - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Evidence = append(m.Evidence, &types1.Evidence{}) - if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRollkit(dAtA[iNdEx:]) diff --git a/types/serialization.go b/types/serialization.go index 98509dfb397..56e31e935f3 100644 --- a/types/serialization.go +++ b/types/serialization.go @@ -1,8 +1,6 @@ package types import ( - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/types" pb "github.com/rollkit/rollkit/types/pb/rollkit" @@ -183,7 +181,8 @@ func (d *Data) ToProto() *pb.Data { return &pb.Data{ Txs: txsToByteSlices(d.Txs), IntermediateStateRoots: d.IntermediateStateRoots.RawRootsList, - Evidence: evidenceToProto(d.Evidence), + // Note: Temporarily remove Evidence #896 + // Evidence: evidenceToProto(d.Evidence), } } @@ -195,7 +194,8 @@ func (b *Block) FromProto(other *pb.Block) error { } b.Data.Txs = byteSlicesToTxs(other.Data.Txs) b.Data.IntermediateStateRoots.RawRootsList = other.Data.IntermediateStateRoots - b.Data.Evidence = evidenceFromProto(other.Data.Evidence) + // Note: Temporarily remove Evidence #896 + // b.Data.Evidence = evidenceFromProto(other.Data.Evidence) return nil } @@ -302,22 +302,24 @@ func byteSlicesToTxs(bytes [][]byte) Txs { return txs } -func evidenceToProto(evidence EvidenceData) []*abci.Evidence { - var ret []*abci.Evidence - for _, e := range evidence.Evidence { - for i := range e.ABCI() { - ae := e.ABCI()[i] - ret = append(ret, &ae) - } - } - return ret -} - -func evidenceFromProto(evidence []*abci.Evidence) EvidenceData { - var ret EvidenceData - // TODO(tzdybal): right now Evidence is just an interface without implementations - return ret -} +// Note: Temporarily remove Evidence #896 + +// func evidenceToProto(evidence EvidenceData) []*abci.Evidence { +// var ret []*abci.Evidence +// for _, e := range evidence.Evidence { +// for i := range e.ABCI() { +// ae := e.ABCI()[i] +// ret = append(ret, &ae) +// } +// } +// return ret +// } + +// func evidenceFromProto(evidence []*abci.Evidence) EvidenceData { +// var ret EvidenceData +// // TODO(tzdybal): right now Evidence is just an interface without implementations +// return ret +// } func signaturesToByteSlices(sigs []Signature) [][]byte { if sigs == nil { diff --git a/types/serialization_test.go b/types/serialization_test.go index 6d7c482082e..ea45ca4b786 100644 --- a/types/serialization_test.go +++ b/types/serialization_test.go @@ -79,7 +79,8 @@ func TestBlockSerializationRoundTrip(t *testing.T) { Txs: nil, IntermediateStateRoots: IntermediateStateRoots{RawRootsList: [][]byte{{0x1}}}, // TODO(tzdybal): update when we have actual evidence types - Evidence: EvidenceData{Evidence: nil}, + // Note: Temporarily remove Evidence #896 + // Evidence: EvidenceData{Evidence: nil}, }, }}, }