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

chore: specify genesis block via env #3650

Merged
merged 1 commit into from
Jun 11, 2022
Merged

chore: specify genesis block via env #3650

merged 1 commit into from
Jun 11, 2022

Conversation

vietanhduong
Copy link
Contributor

@vietanhduong vietanhduong commented Jun 10, 2022

Currently, the genesis block fixed with 0, but there are some chains, the genesis block start from 1.

This PR support specify the genesis block by GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER, default value is 0.

Related Issue: #3648

Signed-off-by: Viet-Anh Duong <[email protected]>
@leoyvens
Copy link
Collaborator

Hi, @vietanhduong, thank you for the patch, have you verified that this patch allows graph node to successfully sync subgraphs on those chains?

@vietanhduong
Copy link
Contributor Author

vietanhduong commented Jun 11, 2022

I have just tested with velas chain, and it's works. The unit test failed seem related to these codes on main branch already failed.

I have run tests on my branch, and everything is fine.

@leoyvens leoyvens merged commit 8e37e1c into graphprotocol:master Jun 11, 2022
@vietanhduong vietanhduong deleted the genesis-block branch June 12, 2022 00:17
@lutter
Copy link
Collaborator

lutter commented Jun 14, 2022

I fear a proper fix for this will require quite a bit more work: the genesis block should really be specified in graph-node.toml for each chain, and needs to also be persisted in the database so it's accessible in other places; I assume there's also quite a few places where we implicitly assume that the number of the genesis block is 0 which we'd need to find and update.

@vietanhduong
Copy link
Contributor Author

@lutter I understand what you consider, but for almost case, the genesis block will start with 0. If there is some problem with the genesis block is start with 1, I think a PR to fix these problems are necessary.

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.

3 participants