openethereum/ethcore
Wei Tang 0ecbb3ec02
Fork choice and metadata framework for Engine (#8401)
* Add light client TODO item

* Move existing total-difficulty-based fork choice check to Engine

* Abstract total difficulty and block provider as Machine::BlockMetadata and Machine::BlockProvider

* Decouple "generate_metadata" logic to Engine

* Use fixed BlockMetadata and BlockProvider type for null and instantseal

In this way they can use total difficulty fork choice check

* Extend blockdetails with metadatas and finalized info

* Extra data update: mark_finalized and update_metadatas

* Check finalized block in Blockchain

* Fix a test constructor in verification mod

* Add total difficulty trait

* Fix type import

* Db migration to V13 with metadata column

* Address grumbles

* metadatas -> metadata

* Use generic type for update_metadata to avoid passing HashMap all around

* Remove metadata in blockdetails

* [WIP] Implement a generic metadata architecture

* [WIP] Metadata insertion logic in BlockChain

* typo: Value -> Self::Value

* [WIP] Temporarily remove Engine::is_new_best interface

So that we don't have too many type errors.

* [WIP] Fix more type errors

* [WIP] ExtendedHeader::PartialEq

* [WIP] Change metadata type Option<Vec<u8>> to Vec<u8>

* [WIP] Remove Metadata Error

* [WIP] Clean up error conversion

* [WIP] finalized -> is_finalized

* [WIP] Mark all fields in ExtrasInsert as pub

* [WIP] Remove unused import

* [WIP] Keep only local metadata info

* Mark metadata as optional

* [WIP] Revert metadata db change in BlockChain

* [WIP] Put finalization in unclosed state

* Use metadata interface in BlockDetail

* [WIP] Fix current build failures

* [WIP] Remove unused blockmetadata struct

* Remove DB migration info

* [WIP] Typo

* Use ExtendedHeader to implement fork choice check

* Implement is_new_best using Ancestry iterator

* Use expect instead of panic

* [WIP] Add ancestry Engine support via on_new_block

* Fix tests

* Emission of ancestry actions

* use_short_version should take account of metadata

* Engine::is_new_best -> Engine::fork_choice

* Use proper expect format as defined in #1026

* panic -> expect

* ancestry_header -> ancestry_with_metadata

* Boxed iterator -> &mut iterator

* Fix tests

* is_new_best -> primitive_fork_choice

* Document how fork_choice works

* Engine::fork_choice -> Engine::primitive_fork_choice

* comment: clarify types of finalization where Engine::primitive_fork_choice works

* Expose FinalizationInfo to Engine

* Fix tests due to merging

* Remove TotalDifficulty trait

* Do not pass FinalizationInfo to Engine

If there's finalized blocks in from route, choose the old branch without calling `Engine::fork_choice`.

* Fix compile

* Fix unused import

* Remove is_to_route_finalized

When no block reorg passes a finalized block, this variable is always false.

* Address format grumbles

* Fix docs: mark_finalized returns None if block hash is not found

`blockchain` mod does not yet have an Error type, so we still temporarily use None here.

* Fix inaccurate tree_route None expect description
2018-05-16 14:58:01 +08:00
..
benches Consolidate crypto functionality in ethcore-crypto. (#8432) 2018-05-05 11:02:33 +02:00
crypto Consolidate crypto functionality in ethcore-crypto. (#8432) 2018-05-05 11:02:33 +02:00
evm EIP 145: Bitwise shifting instructions in EVM (#8451) 2018-05-05 10:23:50 +02:00
light Fork choice and metadata framework for Engine (#8401) 2018-05-16 14:58:01 +08:00
node_filter Bump master to 1.12 (#8477) 2018-04-25 16:25:43 +02:00
private-tx Don't block sync when importing old blocks (#8530) 2018-05-09 08:49:34 +02:00
res Store morden db and keys in "path/to/parity/data/Morden" (ropsten uses "test", like before) (#8621) 2018-05-15 12:57:32 +02:00
service Don't block sync when importing old blocks (#8530) 2018-05-09 08:49:34 +02:00
src Fork choice and metadata framework for Engine (#8401) 2018-05-16 14:58:01 +08:00
stratum Bump master to 1.12 (#8477) 2018-04-25 16:25:43 +02:00
sync Fix packet count when talking with PAR2 peers (#8555) 2018-05-14 10:09:05 +02:00
transaction Rlp decode returns Result (#8527) 2018-05-08 11:22:12 +02:00
types Fork choice and metadata framework for Engine (#8401) 2018-05-16 14:58:01 +08:00
vm Rlp decode returns Result (#8527) 2018-05-08 11:22:12 +02:00
wasm Update wasmi and pwasm-utils (#8493) 2018-04-26 14:00:42 +02:00
Cargo.toml Consolidate crypto functionality in ethcore-crypto. (#8432) 2018-05-05 11:02:33 +02:00