This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fork choice and metadata framework for Engine #8401
Merged
sorpaas
merged 73 commits into
openethereum:master
from
sorpaas:fork-choice-no-metadata
May 16, 2018
Merged
Changes from 2 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
b07ad5f
Add light client TODO item
sorpaas 3c891b9
Move existing total-difficulty-based fork choice check to Engine
sorpaas d272376
Abstract total difficulty and block provider as Machine::BlockMetadat…
sorpaas c4d349c
Decouple "generate_metadata" logic to Engine
sorpaas e1c0252
Merge branch 'master' into fork-choice-no-metadata
sorpaas 1d8149a
Use fixed BlockMetadata and BlockProvider type for null and instantseal
sorpaas d3ef877
Extend blockdetails with metadatas and finalized info
sorpaas f325298
Extra data update: mark_finalized and update_metadatas
sorpaas 6756cef
Check finalized block in Blockchain
sorpaas 7c958b4
Fix a test constructor in verification mod
sorpaas e491abf
Add total difficulty trait
sorpaas 5459695
Fix type import
sorpaas 7fe0d79
Db migration to V13 with metadata column
sorpaas ce105c6
Address grumbles
sorpaas 45b8ce7
metadatas -> metadata
sorpaas f86d4cf
Use generic type for update_metadata to avoid passing HashMap all around
sorpaas 24b6316
Merge branch 'finalize' into fork-choice-no-metadata
sorpaas e797462
Merge branch 'master' of https://github.com/paritytech/parity into fo…
sorpaas c6dd811
Remove metadata in blockdetails
sorpaas fb1cc21
[WIP] Implement a generic metadata architecture
sorpaas 5cb6813
[WIP] Metadata insertion logic in BlockChain
sorpaas f972609
typo: Value -> Self::Value
sorpaas 493e6f0
[WIP] Temporarily remove Engine::is_new_best interface
sorpaas cb5bfcf
[WIP] Fix more type errors
sorpaas fc809c7
[WIP] ExtendedHeader::PartialEq
sorpaas d517ba3
[WIP] Change metadata type Option<Vec<u8>> to Vec<u8>
sorpaas ac37c31
[WIP] Remove Metadata Error
sorpaas 0f36e50
[WIP] Clean up error conversion
sorpaas ef3aa63
[WIP] finalized -> is_finalized
sorpaas 3957c49
[WIP] Mark all fields in ExtrasInsert as pub
sorpaas bc9cc87
[WIP] Remove unused import
sorpaas 4983b68
[WIP] Keep only local metadata info
sorpaas 6009dfa
Mark metadata as optional
sorpaas 13b1b5b
[WIP] Revert metadata db change in BlockChain
sorpaas 723e8a9
[WIP] Put finalization in unclosed state
sorpaas cf34f0d
Use metadata interface in BlockDetail
sorpaas 5861acb
[WIP] Fix current build failures
sorpaas 6d68222
[WIP] Remove unused blockmetadata struct
sorpaas a492830
Remove DB migration info
sorpaas 8a06c4e
[WIP] Typo
sorpaas e673a98
Use ExtendedHeader to implement fork choice check
sorpaas 700779e
Implement is_new_best using Ancestry iterator
sorpaas 143277f
Use expect instead of panic
sorpaas 1dd2ea1
[WIP] Add ancestry Engine support via on_new_block
sorpaas 5d4bd67
Fix tests
sorpaas 704e697
Emission of ancestry actions
sorpaas fdadd42
use_short_version should take account of metadata
sorpaas 60a7a17
Engine::is_new_best -> Engine::fork_choice
sorpaas 78569a0
Use proper expect format as defined in #1026
sorpaas 8d6629b
panic -> expect
sorpaas fda5e75
ancestry_header -> ancestry_with_metadata
sorpaas 45f144d
Boxed iterator -> &mut iterator
sorpaas 86d1ef2
Fix tests
sorpaas 7281726
is_new_best -> primitive_fork_choice
sorpaas d86a056
Document how fork_choice works
sorpaas e7a83f4
Engine::fork_choice -> Engine::primitive_fork_choice
sorpaas 6b6b042
comment: clarify types of finalization where Engine::primitive_fork_c…
sorpaas d36e41f
Merge branch 'master' of https://github.com/paritytech/parity into fo…
sorpaas c593e17
Expose FinalizationInfo to Engine
sorpaas 4900e86
Merge branch 'master' of https://github.com/paritytech/parity into fo…
sorpaas 0b8e55d
Fix tests due to merging
sorpaas 4512b09
Merge branch 'master' into fork-choice-no-metadata
sorpaas 69cc856
Remove TotalDifficulty trait
sorpaas 4df05f0
Merge branch 'master' of https://github.com/paritytech/parity into fo…
sorpaas 60b6def
Do not pass FinalizationInfo to Engine
sorpaas fca4ca1
Merge branch 'master' of https://github.com/paritytech/parity into fo…
sorpaas 15a967b
Fix compile
sorpaas 8d1d98b
Fix unused import
sorpaas 63a3f54
Remove is_to_route_finalized
sorpaas 7b0cd66
Address format grumbles
sorpaas 2c17071
Fix docs: mark_finalized returns None if block hash is not found
sorpaas 819b3d8
Fix inaccurate tree_route None expect description
sorpaas 58756e4
Merge branch 'master' of https://github.com/paritytech/parity into fo…
sorpaas File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we abstract around
total_difficulty
andprovider
at theMachine
level?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an attempt: I added assoc type
Machine::BlockMetadata
andMachine::BlockProvider
, and makeEngine::is_new_best
depend on them only. ForEthEngine
,BlockMetadata
is currently justU256
which is the total difficulty (and we can extend it to containVec<(Bytes, Bytes)>
in the future).Client would first call
Engine::generate_metadata
to get the current set of metadata, and then callEngine::is_new_best
before passing it to blockchain storage.