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

Domain chain network stack updates #2999

Merged
merged 8 commits into from
Sep 10, 2024
Merged

Conversation

shamil-gadelshin
Copy link
Contributor

@shamil-gadelshin shamil-gadelshin commented Sep 2, 2024

This PR prepares the domain networking stack for domain snap-sync.

Changes:

  • new custom request-response protocol for confirmed domain block receipts. We need this protocol to acquire the correct domain block for snap-sync.
  • restore state and block requests protocol for domains. We'll get the required state and block from the domain network using restored protocols.
  • disable domain sync by setting pause_sync variable to true on domain network initialization. We don't rely on Substrate sync in domain network.
  • DomainsApi modification (confirmed domain block receipts) - for exporting the last confirmed domain block from the runtime state and returning it using a new custom protocol.

Code contributor checklist:

- add last_confirmed_domain_block_receipt method
- add network handler for custon request-response protocol
- add get `get_last_confirmed_domain_block_receipt` function to obtain remote domain data
@shamil-gadelshin shamil-gadelshin force-pushed the domain-networking-updates branch from 64041cc to 2796912 Compare September 2, 2024 11:25
Copy link
Member

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'm not familiar enough to approve. Has a minor rustfmt issue.

crates/subspace-service/src/domains.rs Show resolved Hide resolved
domains/service/src/config.rs Show resolved Hide resolved
Copy link
Member

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

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

Make sense in general, left a few nits.

crates/subspace-service/src/domains.rs Show resolved Hide resolved
crates/subspace-service/src/domains/request_handler.rs Outdated Show resolved Hide resolved
tx_handler_controller,
network_starter,
sync_service,
_block_downloader,
Copy link
Member

Choose a reason for hiding this comment

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

Seems _block_downloader is not used, not sure why made this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

block_downloader is exported for the future usage. I will get a domain block body and header to import already downloaded state for the last confirmed domain block.

@shamil-gadelshin shamil-gadelshin added this pull request to the merge queue Sep 10, 2024
Merged via the queue into main with commit 68bce7c Sep 10, 2024
9 checks passed
@shamil-gadelshin shamil-gadelshin deleted the domain-networking-updates branch September 10, 2024 15:16
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.

3 participants