Conversation
|
|
||
| // if current block is first block of last sprint in current span | ||
| h := header.Number.Uint64() | ||
| if span.EndBlock > c.config.Sprint && span.EndBlock-c.config.Sprint+1 == h { |
There was a problem hiding this comment.
Should we check for ANY block of last sprint instead of only first block to be on safer side?
Incase during first blocK, if commitSpan throws error, we need to retry.
There was a problem hiding this comment.
Span fetch needs anchoring. It needs to be fetched at particular point, otherwise it will have problem while replaying the state. Currently, that point is first block of last sprint.
There was a problem hiding this comment.
Got it.
But if checkAndCommitSpan returns error, we should not proceed with block finalisation as span and state is also not committed onto contract.
There was a problem hiding this comment.
Edge cases need to be figured out. Example — figure out a way where no span proposed on heimdall.
| recents, _ := lru.NewARC(inmemorySnapshots) | ||
| signatures, _ := lru.NewARC(inmemorySignatures) | ||
| vABI, _ := abi.JSON(strings.NewReader(validatorsetABI)) | ||
| sABI, _ := abi.JSON(strings.NewReader(stateReceiverABI)) |
There was a problem hiding this comment.
It won't throw error here since ABIs are hardcoded for now.
consensus/bor/bor.go
Outdated
| return nil, err | ||
| } | ||
| // get validators and current span | ||
| validators, _ := c.GetCurrentValidators(number, number+1) |
There was a problem hiding this comment.
Is there a case where this might throw an error?
| } | ||
|
|
||
| // HeimdallSpan represents | ||
| type HeimdallSpan struct { |
There was a problem hiding this comment.
This naming convention is hard to understand, can we think of something better? Maybe more comments.
There was a problem hiding this comment.
We will use Heimdall package directly.
There was a problem hiding this comment.
Okay, resolving for now.
|
@jdkanani please also remove unwanted commented blocks of code. |
0xAshish
left a comment
There was a problem hiding this comment.
Mech wise looks good to me @vaibhavchellani @mankenavenkatesh can review more regarding golang and bor wise things.
|
|
||
| // --- | ||
|
|
||
| // MinimalVal is the minimal validator representation |
There was a problem hiding this comment.
good stuff we need these lightweight structs for p2p communications.
Bor related changes on updated geth
…079) This PR is #1 of a 3-part series that implements the new log index intended to replace core/bloombits. Replaces ethereum/go-ethereum#30370 This part implements the new data structure, the log index generator and the search logic. This PR has most of the complexity but it does not affect any existing code yet so maybe it is easier to review separately. FilterMaps data structure explanation: https://gist.github.com/zsfelfoldi/a60795f9da7ae6422f28c7a34e02a07e Log index generator code overview: https://gist.github.com/zsfelfoldi/97105dff0b1a4f5ed557924a24b9b9e7 Search pattern matcher code overview: https://gist.github.com/zsfelfoldi/5981735641c956afb18065e84f8aff34 Note that the possibility of a tree hashing scheme and remote proof protocol are mentioned in the documents above but they are not exactly specified yet. These specs are WIP and will be finalized after the local log indexer/filter code is finalized and merged. --------- Co-authored-by: Felix Lange <fjl@twurst.com>
No description provided.