Closed brucdarc closed 2 years ago
Refactored verified and finalized blocks into view functions based on confirmations. Let me know how many confirmations seem good for this purpose.
Ready for review, canonical chain tracking along with testing for canonical chain. Implemented test contract folder, where test contracts can inherit main contracts to expose extra testing functionality. Also includes a couple fixes to the environment/cli. I recommend squashing commits before merging because I have a good few here.
This should be mergable pending test result reproduction @gupadhyaya
@brucdarc can you resolve the merge conflicts?
@brucdarc can you resolve the merge conflicts?
Done
Closes #19
Keeps track of the canonical chain using total difficulty, the current fork choice metric for the eth mainnet. Does not keep track of forks other than the canonical chain, instead replaces the canonical chain.
Also I think we should consider removing the verifiedBlocks and finalizedBlocks mappings, and replacing them with view functions that calculate how many confirmations a block on the canonical chain has from the canonical head.