forked from bitpay/bitcore
-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: Ethereum Sync Support #5
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
Open
micahriggan
wants to merge
24
commits into
v8.0.0
Choose a base branch
from
feature/eth-p2p
base: v8.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
micahriggan
pushed a commit
that referenced
this pull request
Oct 24, 2019
Fix circular - bch extends btc
micahriggan
pushed a commit
that referenced
this pull request
May 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently
This branch can connect to an ethereum node and start requesting blocks
Currently working on storing the blocks by changing addBlock and processTransaction to operate on the IBlock and ITransaction types.
In addition to the properties on those types, there is a bucket property that holds chain specific data.
Data added to the bucket property will be stored on blocks, transactions, and coins.
This should allow us to store chain specific data while maintaining one block and transaction model.
Todo
Get balances by processing state transitions in EVM
Config
State
In order to generate the current ethereum state, we must start an EVM with the genesis state, and then run each transaction through the EVM in order to get the new state. The new state's stateroot should match a block's stateroot.
https://github.com/ethereumjs/ethereumjs-vm/blob/master/examples/run-blockchain/index.js
Once we've calculated a state, we can write it to an ETH state collection.
Calculating state can be done after sync, or during sync
The following are example loops with optional logic in brackets.
Sync Loop
State Loop