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: cherry 13816c^..559cd (3d migration) #1322

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(sl): grpc sl add missing batch info (#1309)
  • Loading branch information
srene authored and danwt committed Jan 9, 2025
commit fc62125a08fb535bce2e8ea5ca27634cceac8546
18 changes: 11 additions & 7 deletions settlement/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,13 @@ func (c *Client) saveBatch(batch *settlement.Batch) error {

func (c *Client) convertBatchtoSettlementBatch(batch *types.Batch, daResult *da.ResultSubmitBatch) *settlement.Batch {
bds := []rollapp.BlockDescriptor{}
for _, block := range batch.Blocks {

for index, block := range batch.Blocks {
bd := rollapp.BlockDescriptor{
Height: block.Header.Height,
StateRoot: block.Header.AppHash[:],
Timestamp: block.Header.GetTimestamp(),
Height: block.Header.Height,
StateRoot: block.Header.AppHash[:],
Timestamp: block.Header.GetTimestamp(),
DrsVersion: batch.DRSVersion[index],
}
bds = append(bds, bd)
}
Expand All @@ -359,16 +361,18 @@ func (c *Client) convertBatchtoSettlementBatch(batch *types.Batch, daResult *da.
}

settlementBatch := &settlement.Batch{
Sequencer: proposer.SettlementAddress,
StartHeight: batch.StartHeight(),
EndHeight: batch.EndHeight(),
Sequencer: proposer.SettlementAddress,
StartHeight: batch.StartHeight(),
EndHeight: batch.EndHeight(),
NextSequencer: proposer.SettlementAddress,
MetaData: &settlement.BatchMetaData{
DA: &da.DASubmitMetaData{
Height: daResult.SubmitMetaData.Height,
Client: daResult.SubmitMetaData.Client,
},
},
BlockDescriptors: bds,
NumBlocks: batch.EndHeight() - batch.StartHeight() + 1,
}

return settlementBatch
Expand Down