Skip to content

Fix and polish eth2 API#1

Merged
gballet merged 2 commits intogballet:eth1-eth2-proto1from
mkalinin:eth1-eth2-proto1
Jul 24, 2020
Merged

Fix and polish eth2 API#1
gballet merged 2 commits intogballet:eth1-eth2-proto1from
mkalinin:eth1-eth2-proto1

Conversation

@mkalinin
Copy link

What was done?

  • eth2_produceBlock
    • add a delay that waits for a second if block is about to be produced with the same timestamp as its parent, otherwise produced block fails on import
    • log.Info("Produce block", "parentHash", parentHash)
  • eth2_insertBlock
    • replace InsertChain with InsertChainWithoutSealVerification in eth2_insertBlock
  • eth2_setHead
    • replace api.eth.BlockChain().GetBlockByHash(api.head) with api.eth.BlockChain().CurrentBlock()
    • take a quit if given head is the same as the current one

Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

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

LGTM. Duplicating the whole InsertBlock function will certainly be frowned upon during the final merge. Let's not worry about it until we reach this point, though.

@gballet gballet merged this pull request into gballet:eth1-eth2-proto1 Jul 24, 2020
gballet pushed a commit that referenced this pull request Mar 28, 2025
…ereum#31079)

This PR is #1 of a 3-part series that implements the new log index
intended to replace core/bloombits.
Replaces 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>
gballet pushed a commit that referenced this pull request Sep 11, 2025
…ereum#31079)

This PR is #1 of a 3-part series that implements the new log index
intended to replace core/bloombits.
Replaces 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants