Skip to content

Commit

Permalink
make the fix more succinct
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Mar 20, 2024
1 parent e4bfdb8 commit 0caaeeb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/cometbft/cometbft/libs/log"
mempl "github.com/cometbft/cometbft/mempool"
cmtstate "github.com/cometbft/cometbft/proto/tendermint/state"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cometbft/cometbft/proxy"
"github.com/cometbft/cometbft/types"
)
Expand Down Expand Up @@ -145,13 +144,9 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
}

// update the block with the response from PrepareProposal
block.Data, err = types.DataFromProto(&cmtproto.Data{
Txs: rpp.Txs[:len(rpp.Txs)-1],
Hash: rpp.Txs[len(rpp.Txs)-1],
})
if err != nil {
panic(err)
}
block.Data.Txs = types.ToTxs(rpp.Txs[:len(rpp.Txs)-1])
// update the data hash with the one passed back by celestia-app
block.DataHash = rpp.Txs[len(rpp.Txs)-1]

var blockDataSize int
for _, tx := range block.Txs {
Expand All @@ -160,8 +155,6 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
panic("block data exceeds max amount of allowed bytes")
}
}
// update the data hash with the one passed back by celestia-app
block.DataHash = rpp.Txs[len(rpp.Txs)-1]

return block, block.MakePartSet(types.BlockPartSizeBytes)
}
Expand Down

0 comments on commit 0caaeeb

Please sign in to comment.