Skip to content

Commit

Permalink
IBC fix
Browse files Browse the repository at this point in the history
  • Loading branch information
codchen authored and Cyson committed Mar 24, 2023
1 parent 16d4ce8 commit 47ae4f7
Showing 1 changed file with 63 additions and 3 deletions.
66 changes: 63 additions & 3 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,27 @@ func splitPath(requestPath string) (path []string) {
func (app *BaseApp) PrepareProposal(ctx context.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
defer telemetry.MeasureSince(time.Now(), "abci", "prepare_proposal")

header := tmproto.Header{ChainID: app.ChainID, Height: req.Height, Time: req.Time, ProposerAddress: req.ProposerAddress}
header := tmproto.Header{
ChainID: app.ChainID,
Height: req.Height,
Time: req.Time,
ProposerAddress: req.ProposerAddress,
AppHash: req.AppHash,
NextValidatorsHash: req.NextValidatorsHash,
DataHash: req.DataHash,
ConsensusHash: req.ConsensusHash,
EvidenceHash: req.EvidenceHash,
ValidatorsHash: req.ValidatorsHash,
LastCommitHash: req.LastCommitHash,
LastResultsHash: req.LastResultsHash,
LastBlockId: tmproto.BlockID{
Hash: req.LastBlockHash,
PartSetHeader: tmproto.PartSetHeader{
Total: uint32(req.LastBlockPartSetTotal),
Hash: req.LastBlockPartSetHash,
},
},
}
if app.prepareProposalState == nil {
app.setPrepareProposalState(header)
} else {
Expand Down Expand Up @@ -942,7 +962,27 @@ func (app *BaseApp) PrepareProposal(ctx context.Context, req *abci.RequestPrepar
func (app *BaseApp) ProcessProposal(ctx context.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
defer telemetry.MeasureSince(time.Now(), "abci", "process_proposal")

header := tmproto.Header{ChainID: app.ChainID, Height: req.Height, Time: req.Time, ProposerAddress: req.ProposerAddress}
header := tmproto.Header{
ChainID: app.ChainID,
Height: req.Height,
Time: req.Time,
ProposerAddress: req.ProposerAddress,
AppHash: req.AppHash,
NextValidatorsHash: req.NextValidatorsHash,
DataHash: req.DataHash,
ConsensusHash: req.ConsensusHash,
EvidenceHash: req.EvidenceHash,
ValidatorsHash: req.ValidatorsHash,
LastCommitHash: req.LastCommitHash,
LastResultsHash: req.LastResultsHash,
LastBlockId: tmproto.BlockID{
Hash: req.LastBlockHash,
PartSetHeader: tmproto.PartSetHeader{
Total: uint32(req.LastBlockPartSetTotal),
Hash: req.LastBlockPartSetHash,
},
},
}
if app.processProposalState == nil {
app.setProcessProposalState(header)
} else {
Expand Down Expand Up @@ -989,7 +1029,27 @@ func (app *BaseApp) FinalizeBlock(ctx context.Context, req *abci.RequestFinalize
// Initialize the DeliverTx state. If this is the first block, it should
// already be initialized in InitChain. Otherwise app.deliverState will be
// nil, since it is reset on Commit.
header := tmproto.Header{ChainID: app.ChainID, Height: req.Height, Time: req.Time, ProposerAddress: req.ProposerAddress}
header := tmproto.Header{
ChainID: app.ChainID,
Height: req.Height,
Time: req.Time,
ProposerAddress: req.ProposerAddress,
AppHash: req.AppHash,
NextValidatorsHash: req.NextValidatorsHash,
DataHash: req.DataHash,
ConsensusHash: req.ConsensusHash,
EvidenceHash: req.EvidenceHash,
ValidatorsHash: req.ValidatorsHash,
LastCommitHash: req.LastCommitHash,
LastResultsHash: req.LastResultsHash,
LastBlockId: tmproto.BlockID{
Hash: req.LastBlockHash,
PartSetHeader: tmproto.PartSetHeader{
Total: uint32(req.LastBlockPartSetTotal),
Hash: req.LastBlockPartSetHash,
},
},
}
if app.deliverState == nil {
app.setDeliverState(header)
} else {
Expand Down

0 comments on commit 47ae4f7

Please sign in to comment.