Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(block): removes evidence list, intermediate roots from block #1317

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions block/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, genesisChecksum string
Version: &tmproto.VersionParams{
AppVersion: params.Version.AppVersion,
},
}, Validators: valUpdates,
}, Validators: valUpdates,
AppStateBytes: genesis.AppState,
InitialHeight: genesis.InitialHeight,
GenesisChecksum: genesisChecksum,
Expand Down Expand Up @@ -164,10 +164,8 @@ func (e *Executor) CreateBlock(
ProposerAddress: e.localAddress,
},
Data: types.Data{
Txs: toDymintTxs(mempoolTxs),
IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil},
Evidence: types.EvidenceData{Evidence: nil},
ConsensusMessages: protoutils.FromProtoMsgSliceToAnySlice(e.consensusMsgQueue.Get()...),
Txs: toDymintTxs(mempoolTxs),
ConsensusMessages: protoutils.FromProtoMsgSliceToAnySlice(e.consensusMsgQueue.Get()...),
},
LastCommit: *lastCommit,
}
Expand Down
5 changes: 0 additions & 5 deletions da/celestia/celestia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,21 +324,16 @@ func getRandomBlock(height uint64, nTxs int) *types.Block {
},
Data: types.Data{
Txs: make(types.Txs, nTxs),
IntermediateStateRoots: types.IntermediateStateRoots{
RawRootsList: make([][]byte, nTxs),
},
},
}
copy(block.Header.AppHash[:], getRandomBytes(32))

for i := 0; i < nTxs; i++ {
block.Data.Txs[i] = getRandomTx()
block.Data.IntermediateStateRoots.RawRootsList[i] = getRandomBytes(32)
}

if nTxs == 0 {
block.Data.Txs = nil
block.Data.IntermediateStateRoots.RawRootsList = nil
}

return block
Expand Down
5 changes: 0 additions & 5 deletions da/da_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,17 @@ func getRandomBlock(height uint64, nTxs int) *types.Block {
},
Data: types.Data{
Txs: make(types.Txs, nTxs),
IntermediateStateRoots: types.IntermediateStateRoots{
RawRootsList: make([][]byte, nTxs),
},
},
}
copy(block.Header.AppHash[:], getRandomBytes(32))

for i := 0; i < nTxs; i++ {
block.Data.Txs[i] = getRandomTx()
block.Data.IntermediateStateRoots.RawRootsList[i] = getRandomBytes(32)
}

// TODO(tzdybal): see https://github.com/dymensionxyz/dymint/issues/143
if nTxs == 0 {
block.Data.Txs = nil
block.Data.IntermediateStateRoots.RawRootsList = nil
}

return block
Expand Down
3 changes: 1 addition & 2 deletions proto/types/dymint/dymint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ message Commit {

message Data {
repeated bytes txs = 1;
repeated bytes intermediate_state_roots = 2;
repeated tendermint.abci.Evidence evidence = 3;
reserved 2,3;
repeated google.protobuf.Any consensus_messages = 4;
}

Expand Down
5 changes: 0 additions & 5 deletions rpc/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -934,22 +934,17 @@ func getRandomBlock(height uint64, nTxs int) *types.Block {
},
Data: types.Data{
Txs: make(types.Txs, nTxs),
IntermediateStateRoots: types.IntermediateStateRoots{
RawRootsList: make([][]byte, nTxs),
},
},
}
copy(block.Header.AppHash[:], getRandomBytes(32))

for i := 0; i < nTxs; i++ {
block.Data.Txs[i] = getRandomTx()
block.Data.IntermediateStateRoots.RawRootsList[i] = getRandomBytes(32)
}

// TODO(tzdybal): see https://github.com/dymensionxyz/dymint/issues/143
if nTxs == 0 {
block.Data.Txs = nil
block.Data.IntermediateStateRoots.RawRootsList = nil
}

tmprotoLC, err := tmtypes.CommitFromProto(&tmproto.Commit{})
Expand Down
12 changes: 1 addition & 11 deletions testutil/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ func generateBlock(height uint64, proposerHash []byte, lastHeaderHash [32]byte)
ConsensusMessagesHash: types.ConsMessagesHash(nil),
},
Data: types.Data{
Txs: nil,
IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: [][]byte{{0x1}}},
Evidence: types.EvidenceData{Evidence: nil},
Txs: nil,
},
LastCommit: types.Commit{
Height: 8,
Expand All @@ -115,14 +113,10 @@ func GenerateBlocksWithTxs(startHeight uint64, num uint64, proposerKey crypto.Pr

block.Data = types.Data{
Txs: make(types.Txs, nTxs),
IntermediateStateRoots: types.IntermediateStateRoots{
RawRootsList: make([][]byte, nTxs),
},
}

for i := 0; i < nTxs; i++ {
block.Data.Txs[i] = GetRandomTx()
block.Data.IntermediateStateRoots.RawRootsList[i] = GetRandomBytes(32)
}

signature, err := generateSignature(proposerKey, &block.Header)
Expand Down Expand Up @@ -394,15 +388,11 @@ func GetRandomBlock(height uint64, nTxs int) *types.Block {
},
Data: types.Data{
Txs: make(types.Txs, nTxs),
IntermediateStateRoots: types.IntermediateStateRoots{
RawRootsList: make([][]byte, nTxs),
},
},
}

for i := 0; i < nTxs; i++ {
block.Data.Txs[i] = GetRandomTx()
block.Data.IntermediateStateRoots.RawRootsList[i] = GetRandomBytes(32)
}

return block
Expand Down
6 changes: 2 additions & 4 deletions types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ var (

// Data defines Dymint block data.
type Data struct {
Txs Txs
IntermediateStateRoots IntermediateStateRoots
Evidence EvidenceData
ConsensusMessages []*proto.Any
Txs Txs
ConsensusMessages []*proto.Any
}

// EvidenceData defines how evidence is stored in block.
Expand Down
Loading
Loading