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

Changes to support new block_header_state and block_state #1975

Merged
merged 88 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
61ff571
added hotstuff pseudo code
systemzax Dec 6, 2023
12e3148
simplify `protocol_feature_activation`
greg7mdp Dec 7, 2023
03a226d
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Dec 7, 2023
9bb5575
Revisions to pseudo code
systemzax Dec 7, 2023
c38f1a4
initial changes
greg7mdp Dec 8, 2023
6d862bf
Merge remote-tracking branch 'origin/hotstuff_pseudo_code' into gh_1941
greg7mdp Dec 8, 2023
3fbced5
Update contoller to support both IF and legacy block state classes - wip
greg7mdp Dec 11, 2023
bc025d1
Block state changes - wip
greg7mdp Dec 11, 2023
bb6e688
Revisions to pseudo code
systemzax Dec 11, 2023
5a92916
wip
greg7mdp Dec 11, 2023
e94d146
wip
greg7mdp Dec 12, 2023
eb8ad28
Add document `block_construction_data_flow.md` from Areg
greg7mdp Dec 13, 2023
84f3b85
Implement alternate versions for all `block_stage` variants - wip
greg7mdp Dec 13, 2023
c55909f
Progress on implementing alternate versions for all `block_stage` var…
greg7mdp Dec 14, 2023
47660e1
More progress on implementing alternate versions for all `block_stage…
greg7mdp Dec 15, 2023
3b411a8
Leaps builds and test pass except for those below:
greg7mdp Dec 15, 2023
cb30d5b
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Dec 15, 2023
27439fa
missing in previous merge commit
greg7mdp Dec 15, 2023
c60ded4
My previous merge missed these changes.
greg7mdp Dec 15, 2023
cadcb05
Add comment
greg7mdp Dec 15, 2023
640b3ec
Merge branch 'hotstuff_pseudo_code' of github.com:AntelopeIO/leap int…
greg7mdp Dec 15, 2023
ec1f198
GH-1941 Fixes for GCC
heifner Dec 15, 2023
f324575
GH-1941 actually invoke the function
heifner Dec 15, 2023
b23ab79
Fix gcc warnings
greg7mdp Dec 15, 2023
e85b0bf
Merge branch 'gh_1941' of github.com:AntelopeIO/leap into gh_1941
greg7mdp Dec 15, 2023
331ee19
GH-1941 Comment out test until GH-1980 is worked
heifner Dec 15, 2023
7db4760
Comment out `set_finalizer_test` in api_tests.cpp.
greg7mdp Dec 15, 2023
b6aa4a2
Merge branch 'gh_1941' of github.com:AntelopeIO/leap into gh_1941
greg7mdp Dec 15, 2023
bbf843f
Remove libtester testing on ubuntu20. ubuntu22 should give the covera…
heifner Dec 15, 2023
053c756
Add bls12-381 include directory to libtester build cmake
heifner Dec 15, 2023
8cc1b51
Implement template version of `fork_database`
greg7mdp Dec 15, 2023
0c210c3
Merge branch 'gh_1941' of github.com:AntelopeIO/leap into gh_1941
greg7mdp Dec 15, 2023
7bd4a0e
Define `branch_type` inside `fork_database`.
greg7mdp Dec 15, 2023
6397a0c
wip
greg7mdp Dec 18, 2023
c521919
Make `block_header_state` parent class of `block_state` and revert so…
greg7mdp Dec 19, 2023
6d70dbe
Minimize diffs with `hotstuff_integration` version.
greg7mdp Dec 19, 2023
03db746
Fix issue with tests not passing - `fork_db::add_impl`
greg7mdp Dec 19, 2023
5bcc210
Use `hs_bitset = boost::dynamic_bitset<uint32_t>` which allows faster…
greg7mdp Dec 19, 2023
a3e1abe
Tentative fix for compilation issue in ci/cd
greg7mdp Dec 19, 2023
70cb2c3
Revert previous change
greg7mdp Dec 19, 2023
c2cce4b
Create function for accessing `id()`, streamline `fork_db` index types.
greg7mdp Dec 19, 2023
3269766
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Dec 19, 2023
0159cb2
Unify `multi_index` types for `fork_database`
greg7mdp Dec 19, 2023
42b2a45
Rename member variables in `block_header_state` without leading under…
greg7mdp Dec 19, 2023
88092c3
Minor cleanups.
greg7mdp Dec 19, 2023
60555a4
Remove some `friend` directives in `block_state_legacy`
greg7mdp Dec 19, 2023
fffbe1e
GH-1941 Remove controller::head_block_state()
heifner Dec 20, 2023
b5c6cc0
GH-1941 Remove v1/chain/get_block_header_state
heifner Dec 21, 2023
eddea59
GH-1941 Remove fetch_block_state_by_number()
heifner Dec 21, 2023
c0804e8
GH-2006 Dangling reference
heifner Dec 21, 2023
cb83d8f
GH-2006 Check for null
heifner Dec 21, 2023
2ba8a1a
GH-2006 Check for null
heifner Dec 21, 2023
e012dc1
GH-1941 Use head_block_num()
heifner Dec 21, 2023
bc2ff35
GH-1941 Add head_block_timestamp()
heifner Dec 21, 2023
1258af4
GH-1941 Fix ship startup
heifner Dec 21, 2023
26c61be
GH-1941 Avoid copy
heifner Dec 21, 2023
d5c64a3
Revert "GH-1941 Avoid copy"
heifner Dec 21, 2023
e90f9a1
GH-1941 Removed fetch_block_state_by_id
heifner Dec 21, 2023
65df8b3
GH-1941 Use fetch_block_header_by_number instead of fetch_block_by_nu…
heifner Dec 21, 2023
1bda5c1
Merge pull request #2013 from AntelopeIO/GH-1941-head-block-state
heifner Dec 21, 2023
ef5f032
Use variants for controller's `head` and `fork_db` - wip
greg7mdp Dec 21, 2023
de03c87
Merge branch 'gh_1941' of github.com:AntelopeIO/leap into gh_1941
greg7mdp Dec 21, 2023
617b5b7
wip
greg7mdp Dec 21, 2023
ab5fd63
It builds! And a lot of tests pass.
greg7mdp Dec 21, 2023
d54d3e9
Fix deep_mind logging test
greg7mdp Dec 21, 2023
956c08d
Fix `forked_unit_test` failure. `fork_db.head()->id()` did not check …
greg7mdp Dec 23, 2023
d508795
Remove outdated comment and fix indentation.
greg7mdp Dec 23, 2023
882bb5f
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Dec 23, 2023
08730c6
Add mermaid diagram
greg7mdp Dec 27, 2023
c830bea
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Dec 27, 2023
1ac7744
Move mermaid diagram of block production to docs directory.
greg7mdp Jan 2, 2024
49fcbae
Try adding some quotes to mermaid diagram so that it dosplays in github.
greg7mdp Jan 2, 2024
4a648dc
Embedded markdown does not seem to work correctly in github mermaid.
greg7mdp Jan 2, 2024
e535015
Add comment in fork_database.cpp.
greg7mdp Jan 3, 2024
6eda25a
Cleanup new `apply` functions.
greg7mdp Jan 3, 2024
6207985
Rename variable `block_num` -> `prev_block_num`.
greg7mdp Jan 3, 2024
23c9862
Add a few accessor member functions in `controller_impl` to cleanup t…
greg7mdp Jan 3, 2024
5e6be9d
Add comment and cleanup whitespace.
greg7mdp Jan 3, 2024
6473bc8
Add `controller_impl::head_block()` member function.
greg7mdp Jan 3, 2024
ea199c5
Temporarily disable `reference-contracts` tests.
greg7mdp Jan 3, 2024
346435b
remove unplanned todo.
greg7mdp Jan 3, 2024
8d19355
GH-1941 Update test to use mock signed_block instead of block_state
heifner Jan 4, 2024
96c029d
GH-1941 Update test to use mock signed_block instead of block_state
heifner Jan 4, 2024
32b1d2e
GH-1941 Update test to use mock signed_block instead of block_state
heifner Jan 4, 2024
e1295ae
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Jan 4, 2024
2af37fc
Merge branch 'hotstuff_integration' of github.com:AntelopeIO/leap int…
greg7mdp Jan 4, 2024
029d5d7
Merge branch 'gh_1941' of github.com:AntelopeIO/leap into gh_1941
greg7mdp Jan 4, 2024
c17ecf9
Minor changes from PR review
greg7mdp Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,22 @@ jobs:
rm ./*.deb

# Reference Contracts
- name: checkout reference-contracts
uses: actions/checkout@v4
with:
repository: AntelopeIO/reference-contracts
path: reference-contracts
ref: '${{needs.v.outputs.reference-contracts-ref}}'
- if: ${{ matrix.test == 'deb-install' }}
name: Install reference-contracts deps
run: |
apt-get -y install cmake build-essential
- name: Build & Test reference-contracts
run: |
cmake -S reference-contracts -B reference-contracts/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_LEAP_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off
cmake --build reference-contracts/build -- -j $(nproc)
cd reference-contracts/build/tests
ctest --output-on-failure -j $(nproc)
# - name: checkout reference-contracts
# uses: actions/checkout@v4
# with:
# repository: AntelopeIO/reference-contracts
# path: reference-contracts
# ref: '${{needs.v.outputs.reference-contracts-ref}}'
# - if: ${{ matrix.test == 'deb-install' }}
# name: Install reference-contracts deps
# run: |
# apt-get -y install cmake build-essential
# - name: Build & Test reference-contracts
# run: |
# cmake -S reference-contracts -B reference-contracts/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_LEAP_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off
# cmake --build reference-contracts/build -- -j $(nproc)
# cd reference-contracts/build/tests
# ctest --output-on-failure -j $(nproc)

all-passing:
name: All Required Tests Passed
Expand Down
1 change: 1 addition & 0 deletions CMakeModules/EosioTesterBuild.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ target_include_directories(EosioChain INTERFACE
@CMAKE_BINARY_DIR@/libraries/chain/include
@CMAKE_SOURCE_DIR@/libraries/libfc/include
@CMAKE_SOURCE_DIR@/libraries/libfc/libraries/boringssl/boringssl/src/include
@CMAKE_SOURCE_DIR@/libraries/libfc/libraries/bls12-381/include
@CMAKE_SOURCE_DIR@/libraries/softfloat/source/include
@CMAKE_SOURCE_DIR@/libraries/appbase/include
@CMAKE_SOURCE_DIR@/libraries/chainbase/include
Expand Down
27 changes: 27 additions & 0 deletions docs/block_production/lifecycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The following diagram describes Leap block production, as implemented in `libraries/chain/controller.cpp`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file probably should be located inside /docs/01_nodeos. But you can move it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed @ericpassmore 's suggestion for the file path, but happy to move it if desirable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no changes for now.


```mermaid
flowchart TD
pp[producer_plugin] --> D
A("replay()"):::fun --> B("replay_push_block()"):::fun
B --> E("maybe_switch_forks()"):::fun
C("init()"):::fun ---> E
C --> A
D("push_block()"):::fun ---> E
subgraph G["apply_block()"]
direction TB
start -- "stage = &Oslash;" --> sb
sb("start_block()"):::fun -- "stage = building_block" --> et
et["execute transactions" ] -- "stage = building_block" --> fb("finalize_block()"):::fun
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does stage still stay in building_block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not understanding exactly what you are asking.

Copy link
Member

@linh2931 linh2931 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After executing transactions, is the stage still building_block? ("stage = building_block" in the chart)

yes, it is.

fb -- "stage = assembled block" --> cb["add transaction metadata and create completed block"]
cb -- "stage = completed block" --> commit("commit_block() (where we [maybe] add to fork_db and mark valid)"):::fun

end
B ----> start
E --> G
D --> F("log_irreversible()"):::fun
commit -- "stage = &Oslash;" --> F
F -- "if in irreversible mode" --> G

classDef fun fill:#f96
```
Loading