-
Notifications
You must be signed in to change notification settings - Fork 262
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
chainHead based backend implementation #1161
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8c4228f
add follow_stream impl
jsdw ae2d938
follow_stream_unpin first draft
jsdw b7293b0
add tests for follow_stream_unpin
jsdw f420929
more tests and fixes for follow_stream_unpin
jsdw 0f578ee
first pass follow_stream_driver
jsdw c237f45
follow_stream_driver: add tests, fix things, buffer events from last …
jsdw 02990bf
First pass finishing Backend impl
jsdw d5c3dba
Fix test compile issues
jsdw 894da8d
clippy fixes
jsdw 7252b3c
clippy fix and consistify light_client
jsdw 0e78d16
revert lightclient tweak
jsdw 1161886
revert other lightclient thing
jsdw c056443
cargo fmt
jsdw c31fbe6
start testing unstable backend behind feature flag
jsdw cc7fd90
more test fixes and move test-runtime metadata path just incase
jsdw 3a58c86
fix compile error
jsdw 5786954
ensure transaction progress stream actually used and fix another test
jsdw 68f2570
Merge branch 'master' into jsdw-unstable-backend
jsdw c3a2d16
cargo fmt
jsdw d14e984
CI tweak
jsdw 702a1dc
improve some comments and address some feedback bits
jsdw f331277
Merge branch 'master' into jsdw-unstable-backend
jsdw 69c4b54
update CI to use our own nightly binary
jsdw 12902d7
wait for finalized block perhaps
jsdw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ concurrency: | |
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
# TODO: Currently pointing at latest substrate; is there a suitable binary we can pin to here? | ||
SUBSTRATE_URL: https://releases.parity.io/substrate/x86_64-debian:bullseye/latest/substrate/substrate | ||
# Increase wasm test timeout from 20 seconds (default) to 1 minute. | ||
WASM_BINDGEN_TEST_TIMEOUT: 60 | ||
|
||
|
@@ -31,13 +29,19 @@ jobs: | |
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Substrate | ||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
curl $SUBSTRATE_URL --output substrate-node --location | ||
chmod +x substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
mv substrate-node ~/.local/bin | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
|
@@ -137,13 +141,19 @@ jobs: | |
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Substrate | ||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
curl $SUBSTRATE_URL --output substrate-node --location | ||
chmod +x substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
mv substrate-node ~/.local/bin | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
|
@@ -165,19 +175,25 @@ jobs: | |
args: --doc | ||
|
||
tests: | ||
name: "Test non-wasm" | ||
name: "Test (Native)" | ||
runs-on: ubuntu-latest-16-cores | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Substrate | ||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
curl $SUBSTRATE_URL --output substrate-node --location | ||
chmod +x substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
mv substrate-node ~/.local/bin | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
|
@@ -198,21 +214,26 @@ jobs: | |
command: nextest | ||
args: run --workspace | ||
|
||
light_client_tests: | ||
name: "Test Light Client" | ||
unstable_backend_tests: | ||
name: "Test (Unstable Backend)" | ||
runs-on: ubuntu-latest-16-cores | ||
timeout-minutes: 25 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download Substrate | ||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
curl $SUBSTRATE_URL --output substrate-node --location | ||
chmod +x substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
mv substrate-node ~/.local/bin | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
|
@@ -222,48 +243,57 @@ jobs: | |
override: true | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # v2.6.2 | ||
|
||
- name: Install cargo-nextest | ||
run: cargo install cargo-nextest | ||
|
||
- name: Run tests | ||
uses: actions-rs/[email protected] | ||
with: | ||
command: test | ||
args: --release --package integration-tests --features unstable-light-client | ||
command: nextest | ||
args: run --workspace --features unstable-backend-client | ||
|
||
clippy: | ||
name: Cargo clippy | ||
runs-on: ubuntu-latest | ||
light_client_tests: | ||
name: "Test (Light Client)" | ||
runs-on: ubuntu-latest-16-cores | ||
timeout-minutes: 25 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Substrate | ||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
curl $SUBSTRATE_URL --output substrate-node --location | ||
chmod +x substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
mv substrate-node ~/.local/bin | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
|
||
- name: Run clippy | ||
uses: actions-rs/cargo@v1 | ||
- name: Run tests | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: clippy | ||
args: --all-targets -- -D warnings | ||
command: test | ||
args: --release --package integration-tests --features unstable-light-client | ||
|
||
wasm_tests: | ||
name: Test wasm | ||
name: Test (WASM) | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -281,13 +311,19 @@ jobs: | |
- name: Rust Cache | ||
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
|
||
- name: Download Substrate | ||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
curl $SUBSTRATE_URL --output substrate-node --location | ||
chmod +x substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
mv substrate-node ~/.local/bin | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Run subxt WASM tests | ||
run: | | ||
|
@@ -314,3 +350,41 @@ jobs: | |
wasm-pack test --headless --firefox | ||
wasm-pack test --headless --chrome | ||
working-directory: signer/wasm-tests | ||
|
||
clippy: | ||
name: Cargo clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download substrate-node binary | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 | ||
with: | ||
workflow: build-substrate.yml | ||
name: nightly-substrate-binary | ||
|
||
- name: Prepare substrate-node binary | ||
run: | | ||
chmod u+x ./substrate-node | ||
./substrate-node --version | ||
mkdir -p ~/.local/bin | ||
cp ./substrate-node ~/.local/bin | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
|
||
- name: Run clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets -- -D warnings |
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
Oops, something went wrong.
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.
Question: What is the advantage of
transfer_allow_death
over the normaltransfer
here?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.
transfer
actually disappeared from the recent version of the balances pallet, and was replaced with two functions:transfer_keep_alive
andtransfer_allow_death
.transfer_keep_alive
will reject doing a transfer that would bring your balance below the existential deposit (ED) amount (which, if happens, would allow the account to be repeaed, ie disappear entirely with any remaining balance going away)transfer_allow_death
is the same as the oldtransfer
call afaiu, and will allow the transfer to occur even if it leads to the acoucnt being reaped :)And so, I just renamed all uses of
transfer
that I found totransfer_allow_death
to keep the same logic as before to make CI happy. (well, happier)