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

Process chain segment #1934

Merged
merged 4 commits into from
Jan 13, 2021
Merged

Process chain segment #1934

merged 4 commits into from
Jan 13, 2021

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jan 11, 2021

resolves #1772

  • new api chain.processChainSegment() to process a linear chain until completed
  • Regular Sync to use chain.processChainSegment(), removed its own processor
  • Tested with Pyrmont: synced to head 2 times
2021-01-11 16:09:24 [SYNC]             info: Regular Sync: processed up to current slot slot=387946
2021-01-11 16:09:33 [SYNC]             info: Regular Sync: wait for best peer
2021-01-11 16:09:33 [SYNC]             info: Regular Sync: fetcher returns empty array, finish sync now

@github-actions github-actions bot added the scope-networking All issues related to networking, gossip, and libp2p. label Jan 11, 2021
@codeclimate
Copy link

codeclimate bot commented Jan 11, 2021

Code Climate has analyzed commit 0cdc0e9 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@twoeths twoeths changed the title Tuyen/process chain segment Process chain segment Jan 11, 2021
@twoeths twoeths marked this pull request as ready for review January 11, 2021 10:04
dapplion
dapplion previously approved these changes Jan 11, 2021
@@ -105,4 +112,8 @@ export interface IBeaconChain {
* Pre-process and run the per slot state transition function
*/
receiveBlock(signedBlock: SignedBeaconBlock, trusted?: boolean): Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to return void so it's not misleading? the behaviour is very different to processChainSegment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say yes, would like @wemeetagain to confirm through. I can to create a separate PR if we want to do that.

at least what I see is the name receive* vs. process* is the main difference between these 2 apis.

dapplion
dapplion previously approved these changes Jan 13, 2021
@dapplion dapplion merged commit 8bd9cc4 into master Jan 13, 2021
@dapplion dapplion deleted the tuyen/process-chain-segment branch January 13, 2021 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-networking All issues related to networking, gossip, and libp2p.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add block range API to chain
2 participants