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

Refactor blockchain_service methods #1577

Open
fishseabowl opened this issue Jan 31, 2023 · 0 comments
Open

Refactor blockchain_service methods #1577

fishseabowl opened this issue Jan 31, 2023 · 0 comments
Assignees
Labels
triage This is a new issue that needs to be reviewed at our Sprint Planning

Comments

@fishseabowl
Copy link
Member

fishseabowl commented Jan 31, 2023

Refactor some events and related methods of blockchain_service to remove redundancy and make more sense.

  1. Remove PullBlocksFromPeer event, it was confused with HandlePullBlocks event
    PullBlocksFromPeer {
        peer_id: PeerId,
        sender: oneshot::Sender<Result<Ordinal, BlockchainError>>,
    },
  1. Add QueryBlockOrdinalLocal event to check the last ordinal of the local blockchain
    QueryBlockOrdinalLocal {
        sender: oneshot::Sender<anyhow::Result<Ordinal>>,
    },
  1. Rename PullBlocksLocal event to FetchBlocksLocal

  2. Add a new field: peer_id to HandlePullBlocks event and change the type of the fieldsender to oneshot::Sender<anyhow::Result<Vec<Block>>>

    HandlePullBlocks { 
        start: Ordinal,
        end: Ordinal,
        peer_id: PeerId,
        sender: oneshot::Sender<anyhow::Result<Vec<Block>>>,
    },
  1. Add a new field: peer_id to HandleQueryBlockOrdinal event
    HandleQueryBlockOrdinal {
        peer_id: PeerId,
        sender: oneshot::Sender<anyhow::Result<Ordinal>>,
    },

All of the above are currently under development and may change during implementation. Please feel free to add comments. thank you very much.

@github-actions github-actions bot added the triage This is a new issue that needs to be reviewed at our Sprint Planning label Jan 31, 2023
@fishseabowl fishseabowl self-assigned this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage This is a new issue that needs to be reviewed at our Sprint Planning
Projects
Status: Backlog
Development

No branches or pull requests

1 participant