-
Notifications
You must be signed in to change notification settings - Fork 781
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
Client: add VM execution #1028
Client: add VM execution #1028
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
Some more debugging: integration test failure is due to FullSynchronizer.best() not delivering a peer on the |
This difficulty check |
Ok, tests are passing and client run is working both initially and resumed upon an existing chain state, so this is now ready for review. 😄 The devp2p changes from 8bfec9d are technically independent from this PR, I did this yesterday because sync start did take so long and often was unreliable so it got very much a hazzle to further debug the PR. The change is subdividing the peer |
8f506ae
to
fb2826d
Compare
Rebased this. |
This is now open for review (and merge), #1030 should subsequently automatically update its base. |
a8d7cca
to
1d4ca4f
Compare
Rebased this on top of #1026 |
Hi @jochem-brouwer, good morning 😀 , then only thing I would insist upon: can we please get this merged before you start rewriting the cache mechanism for trie? This is otherwise getting a bit hairy. This PR shouldn't be too hard to review, especially since the core logic was rewritten by yourself, some explanations: After rebasing upon your fetcher type improvements in 1fe5e03 I did the following:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some questions, but nothing alarming. Looks good! 😄
@@ -47,6 +52,7 @@ export abstract class Synchronizer extends EventEmitter { | |||
|
|||
this.pool = options.pool | |||
this.chain = options.chain | |||
this.stateDB = options.stateDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need stateDB
here, since it does not seem we use it anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it there and not directly in FullSynchronizer
since I thought this might be more flexible if we want to use stateDB
in other synchronizers. Do you want me to move over to FullSynchronizer
directly? Don't have a strong opinion on this myself, think these are all things which can be easily evolved and adopted further down the road.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no strong opinion either, it is OK to keep it here for now, if we focus on the light client then we can remove it if it turns out it is unnecessary.
…ance for a clear synchronizer object association
…ded state persistence by introducing StateManager
vm: add maxBlocks option to runBlockchain
client: fullsync: ensure VM executes final block upon shutdown
…uest) along import/execution decoupling, added tx number in block to execution message
…cks with 0 txs (performance)
…ferentiation towards stateDB
… directory structures
…ed missed out test base directory tests (e.g. test/client.spec.ts) to test:unit package.json command
…ls for improved discovery performance and to avoid network traffic spikes
…r flow internet connections, fixed rebase bug in DPT.refresh()
…sh coalescent operator for options.refreshInterval selection in DPT
…, removed checkpointing exception for zero tx blocks in VM.runBlocks()
1d4ca4f
to
dc2c99e
Compare
@jochem-brouwer ok, just pushed the changes, ready for re-review. 😀 |
|
||
// Tracking vars for log msg condensation on zero tx blocks | ||
private NUM_ZERO_TXS_PER_LOG_MSG = 50 | ||
public zeroTxsBlockLogMsgCounter: number = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't think need the number
type annotation since it's being initialized with 0
@@ -55,6 +55,7 @@ export class DPT extends EventEmitter { | |||
private _kbucket: KBucket | |||
private _server: DPTServer | |||
private _refreshIntervalId: NodeJS.Timeout | |||
private _refreshIntervalSelectionCounter: number = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same nit here for number
type annotation, I believe not needed when already initialized with a number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, great!! 😄
I assume that first this one gets moved into master and then the checkpoint one immediately after? |
@jochem-brouwer thanks for the review 😄 , yes, I will now first merge here. |
Continuation of #1017
This has been rebased on top of #1023 and is working apart from one integration test failing (FullSync, this is going into an endless loop in the
while
loop insync.start()
).Will give some more comments on the changes later the day.
We should merge relatively soon otherwise this is getting a bit out of hands. 😋