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

Implement GetManifest , Manifest, GetUtxoSnapshotChunk, UtxoSnapshotChunk p2p messages #1552

Closed
kushti opened this issue Dec 30, 2021 · 2 comments
Assignees

Comments

@kushti
Copy link
Member

kushti commented Dec 30, 2021

Implement following new messages on top of #1514

  • GetManifest - send manifest (BatchAVLProverManifest) identifier
  • Manifest - do SnapshotsDb.readManifestBytes and send manifest bytes over wire
  • GetUtxoSnapshotChunk - send utxo subtree (BatchAVLProverSubtree) identifier
  • UtxoSnapshotChunk - do SnapshotsDb.readSubtreeBytes and send subtree bytes over wire
  • tests
@knizhnik
Copy link
Collaborator

knizhnik commented Jan 1, 2022

I wonder why SnapshotsDb.readSubtreeBytes and SnapshotsDb.readManifestBytes methods are called read*Bytes while them are actually returning deserialized BatchAVLProverManifest and BatchAVLProverSubtree?
Should I serialize them in array of bytes?
And is there any sense in serializing data fetched from the database to immediately serialize it back to send through network?

@kushti
Copy link
Member Author

kushti commented Jan 4, 2022

I wonder why SnapshotsDb.readSubtreeBytes and SnapshotsDb.readManifestBytes methods are called read*Bytes while them are actually returning deserialized BatchAVLProverManifest and BatchAVLProverSubtree? Should I serialize them in array of bytes? And is there any sense in serializing data fetched from the database to immediately serialize it back to send through network?

No sense in serialization round-trip just to send bytes over the wire.

Thus I think it is better to have SnapshotsDb.readSubtreeBytes / SnapshotsDb.readManifestBytes methods (reading bytes) along with SnapshotsDb.readSubtree / SnapshotsDb.readManifest (reading entities) , and use former for p2p messaging

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

No branches or pull requests

2 participants