Conversation
| ): Receive = { | ||
| case ReportStats => | ||
| syncInitiator ! StateSyncStats( | ||
| currentStats.saved + currentState.memBatch.size, |
There was a problem hiding this comment.
again question of granularity, as if restart happen and membatch won't be persisted then user may end up with lesser number of nodes reporter after restart. If someone is paranoic enought it can mean for him that some data was lost (i kinda already see QA reporting it that some nodes were lost while testing restarting :D )
There was a problem hiding this comment.
I see your point. Let me test that as I'm not 100% sure whether that's the wanted behavior
2691c6c to
3b81587
Compare
|
After margin [ETCM-141] scalafmt . This PR can be updated by git merge Changes: |
| ec: ExecutionContext | ||
| ): Future[(List[Block], Option[Any])] = | ||
| if (blocks.isEmpty) { | ||
| supervisor ! ProgressProtocol.ImportedBlock(importedBlocks.map(_.number).max) |
There was a problem hiding this comment.
It could be importedBlocks.headOption.map(_.number).getOrElse(0). In the case when we ex. try to import 1 block and it will be a duplicate importedBlocks.map(_.number).max will return an exception
| highestBlock = highestBlock | ||
| def syncing(req: SyncingRequest): ServiceResponse[SyncingResponse] = | ||
| syncingController | ||
| .ask(SyncProtocol.GetStatus)(getTransactionFromPoolTimeout) |
There was a problem hiding this comment.
Why getTransactionFromPoolTimeout ?
| peers-to-choose-pivot-block-margin = 1 | ||
| pivot-block-offset = 500 | ||
| min-peers-to-choose-target-block = 2 | ||
| target-block-offset = 500 |
There was a problem hiding this comment.
Why did you make this change? I think it is incorrect. min-peers-to-choose-target-block and target-block-offset are not used anymore
There was a problem hiding this comment.
Wrong resolution after merging in changes in pivot block selection. Fixed
| val defaultState = | ||
| SyncState(defaultpivotBlockHeader, defaultSafeDownloadTarget, bestBlockHeaderNumber = defaultBestBlock) | ||
| SyncState( | ||
| defaultpivotBlockHeader, |
There was a problem hiding this comment.
Very minor: it should be defaultPivotBlockHeader
631d3a1 to
443ea00
Compare
| it should "sync state to different tries when peer provide mixed responses" in new TestSetup() { | ||
| forAll(ObjectGenerators.genMultipleNodeData(1000)) { nodeData => | ||
| val initiator = TestProbe() | ||
| initiator.ignoreMsg { case SyncStateSchedulerActor.StateSyncStats(_, _) => true } |
There was a problem hiding this comment.
this need to be added also in last test start state sync when receiving start signal while bloom filter is loading
443ea00 to
e9f1032
Compare
b57793f to
dde2b38
Compare
[ETCM-175][WIP] Introduce sync protocol, provide (not working yet :() tests for both regular sync and fast sync, provide initial implementation of reporting sync progress through SyncController [ETCM-175] Make RegularSync reporting progress properly [ETCM-175] Fix most of sync reporting tests [ETCM-175] Make all tests pass 🎇 [ETCM-175] Switch eth_syncing to use SyncProtocol now [ETCM-175] Cleanup [ETCM-175] Update state sync progress with each response received [ETCM-175] Rename best known block in regular sync progress state [ETCM-175] Filer out empty state progress in fast sync [ETCM-175] Return initial incomplete state on fast sync [ETCM-175] Introduce config for ask timeout
dde2b38 to
6a67888
Compare
Description
Update
eth_syncingmethod to standarized output (https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/etclabscore/ethereum-json-rpc-specification/master/openrpc.json&uiSchema%5BappBar%5D%5Bui:input%5D=false)) and move sync progress reporting into sync module.Important Changes Introduced
A
SyncProtocolis used now for high-level communication between sync controller and specific implementations as well as outside sync controller. Probably it makes sense to further extend that change and hide it behind a well-typed task-returning interfaces.State breakage is related to changed datatype for tracking state nodes progress - from
InttoLong(as in sync state scheduler)Testing
eth_syncingshould return full response, including information about state nodes.