fix: don't unpin blocks that may show up again (#1368)

* backend(fix): Early unpin for pruned blocks with no active `BlockRef`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* backend/tests: Check unpinning only after max_life time

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* backend/tests: Remove unpinning when droped tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* backend/tests: Ensure new blocks are not unpinned

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* backend: Add only pruned blocks to unpin hashset and add a test

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* backend: Introduce the `UnpinPolicy`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update subxt/src/backend/unstable/follow_stream_unpin.rs

* backend: Fix clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Only unpin blocks that have been pruned by the backend

* Fix comments

* Mark initialized and finalized blocks as 'can_be_unpinned' too and tests

* fmt

* tweak a couple more comments

* tidy tests and fix undeterministic check

* Fix wrong names in comments

* tweak another test to focus it a bit more

* clippy

* wee rename of args in a couple of test helpers

* add some logs and simplify submit_transaction in the same way Alex did

* ditch logging again and keep to the experiment pr

* cargo fmt

* reduce CI timeouts to 30mins

* Handle Init and Stop events in submit_transaction too, just in case

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
This commit is contained in:
James Wilson
2024-01-17 09:35:02 +00:00
committed by GitHub
parent df85e46a62
commit 553343548e
5 changed files with 268 additions and 100 deletions
+4 -4
View File
@@ -159,7 +159,7 @@ jobs:
tests:
name: "Test (Native)"
runs-on: ubuntu-latest-16-cores
timeout-minutes: 45
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -189,7 +189,7 @@ jobs:
unstable_backend_tests:
name: "Test (Unstable Backend)"
runs-on: ubuntu-latest-16-cores
timeout-minutes: 45
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -219,7 +219,7 @@ jobs:
light_client_tests:
name: "Test (Light Client)"
runs-on: ubuntu-latest-16-cores
timeout-minutes: 45
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -246,7 +246,7 @@ jobs:
wasm_tests:
name: Test (WASM)
runs-on: ubuntu-latest
timeout-minutes: 45
timeout-minutes: 30
env:
# Set timeout for wasm tests to be much bigger than the default 20 secs.
WASM_BINDGEN_TEST_TIMEOUT: 300