Skip to content

Commit

Permalink
Merge pull request #1975 from AntelopeIO/gh_1941
Browse files Browse the repository at this point in the history
Changes to support new `block_header_state` and `block_state`
  • Loading branch information
greg7mdp authored Jan 4, 2024
2 parents a25a8c4 + c17ecf9 commit 14963e2
Show file tree
Hide file tree
Showing 59 changed files with 3,394 additions and 2,606 deletions.
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
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`:

```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 = Ø" --> sb
sb("start_block()"):::fun -- "stage = building_block" --> et
et["execute transactions" ] -- "stage = building_block" --> fb("finalize_block()"):::fun
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 = Ø" --> F
F -- "if in irreversible mode" --> G
classDef fun fill:#f96
```
Loading

0 comments on commit 14963e2

Please sign in to comment.