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

Added copying for metablocks too #27

Open
wants to merge 9 commits into
base: feat/hyperblock
Choose a base branch
from
Open

Conversation

cristure
Copy link

Added whole copying mechanism similar to the one in shard blocks due to a serialization issue of hashes in proto.

@cristure cristure changed the base branch from main to feat/hyperblock December 20, 2024 14:14
ssd04
ssd04 previously approved these changes Dec 23, 2024
@ssd04 ssd04 dismissed their stale review December 23, 2024 13:19

mistake

process/outportBlockConverter.go Outdated Show resolved Hide resolved
Comment on lines 360 to 363
return nil, nil
}
if len(outportTxPool.Transactions) == 0 {
return nil, nil
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think it is fine to return here nil, nil

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe at least an empty TransactionPool

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

}, nil
}

func (o *outportBlockConverter) handleTransactionPoolV2(outportTxPool *outport.TransactionPool) (*hyperOutportBlocks.TransactionPoolV2, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same in this func

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -535,7 +674,71 @@ func (o *outportBlockConverter) HandleShardOutportBlock(outportBlock *outport.Ou
return shardOutportBlock, nil
}

func (o *outportBlockConverter) copyTransactions(sourceTxs map[string]*outport.TxInfo, transactionPool *hyperOutportBlocks.TransactionPoolV2) error {
func (o *outportBlockConverter) copyTransactions(sourceTxs map[string]*outport.TxInfo) (map[string]*hyperOutportBlocks.TxInfo, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for copyTransactions we return txs and for copyTransactionsV2 we pass the map and modify it, can we have the same approach?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced.

return txInfo, nil
}

func (o *outportBlockConverter) copyTransactionsV2(sourceTxs map[string]*outport.TxInfo, transactionPool *hyperOutportBlocks.TransactionPoolV2) error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we still need copyTransactions v1 and v2?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for other copies

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metaoutportblock is using TxInfoV1. I could switch that as well, and therefore removed the whole versioning.

}, nil
}

// HandleShardOutportBlock will convert an outport.OutportBlock to hyperOutportBlocks.ShardOutportBlockV2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment here, without v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants