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

Ab/sqlite #2284

Merged
merged 101 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
94d642d
update query-service to ab/sqlite-support
imabdulbasit Nov 11, 2024
337469c
..
imabdulbasit Nov 14, 2024
3d8cb3e
use embedded-db for devnode
imabdulbasit Nov 14, 2024
c345591
uncomment marketplace builder tests
imabdulbasit Nov 14, 2024
7a8b113
point query-service to ab/sqlite-support
imabdulbasit Nov 14, 2024
8aa2ed3
migrations to update state tables columns
imabdulbasit Nov 14, 2024
164c99a
update comments for sql options
imabdulbasit Nov 14, 2024
9dde077
update justfile
imabdulbasit Nov 14, 2024
16fc211
enable embedded-db for devnode
imabdulbasit Nov 14, 2024
427c33f
fix record action query for postgres
imabdulbasit Nov 14, 2024
a97bd18
fix record action query for postgres
imabdulbasit Nov 14, 2024
ff44a1a
try with only testing feature
imabdulbasit Nov 14, 2024
11a899d
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 14, 2024
6cc9acb
rm settings.json
imabdulbasit Nov 14, 2024
78b5abd
lint
imabdulbasit Nov 14, 2024
0d52d7f
add process-compose for sqlite, fix migration, update query-service
imabdulbasit Nov 17, 2024
bbcce8d
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 17, 2024
0d63fbf
update query-service
imabdulbasit Nov 17, 2024
a6dbd91
pass persistence to init_node(), fix migrations, rm create_catchup_pr…
imabdulbasit Nov 18, 2024
00db3f9
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 18, 2024
425320f
fix migration version
imabdulbasit Nov 18, 2024
c8937e2
fix migration version
imabdulbasit Nov 18, 2024
da75a12
fix migration
imabdulbasit Nov 18, 2024
993aba6
fix migration
imabdulbasit Nov 19, 2024
561d24b
sequencer-sqlite
imabdulbasit Nov 20, 2024
c7190ad
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 20, 2024
9f61454
update sequencer-sqlite lockfile
imabdulbasit Nov 20, 2024
6e00a84
fix archive name
imabdulbasit Nov 20, 2024
22eeef9
fix archive name
imabdulbasit Nov 20, 2024
0d64fd1
update name
imabdulbasit Nov 20, 2024
80cb17c
fix test_integration ci
imabdulbasit Nov 20, 2024
ea320e4
fix sequencer-sqlite dockerfile
imabdulbasit Nov 20, 2024
0aea703
try with disabling aggregator
imabdulbasit Nov 20, 2024
1122f62
fix sqlite migration for merkle root columns && enable restart_tests
imabdulbasit Nov 20, 2024
7827c2c
enable aggregator
imabdulbasit Nov 20, 2024
8b64540
set ESPRESSO_STATE_SIGNATURE_TOTAL_STAKE to 7
imabdulbasit Nov 20, 2024
17f8f23
fix merkel_root_columns && use same persistence in test_restart
imabdulbasit Nov 20, 2024
7c0e158
set connection parameters, revert tx delay to 2s, update query-service
imabdulbasit Nov 20, 2024
12c8e6b
comment out max connections setting
imabdulbasit Nov 20, 2024
403826c
set max_connections for tmp db options
imabdulbasit Nov 20, 2024
9d014d5
add sqlite nodes in docker-compose
imabdulbasit Nov 21, 2024
d50cf01
enable embedded-db feature for devnode
imabdulbasit Nov 21, 2024
a8d5209
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 21, 2024
908f9bc
merge origin/main
imabdulbasit Nov 21, 2024
ae75384
nix: fix process-compose demo
sveitser Nov 21, 2024
a0ca05f
ci: compile diff-test with test profile
sveitser Nov 21, 2024
18eb7b3
remove docker pull from integration test
imabdulbasit Nov 21, 2024
9902e23
comment out cleaning up tempdir in demo-native
imabdulbasit Nov 21, 2024
70efa9a
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 21, 2024
5d5813d
update hotshot-query-service
imabdulbasit Nov 21, 2024
8db8f96
ci: don't clean up process compose storage dir
sveitser Nov 22, 2024
6968baf
ci: upload demo native process compose logs
sveitser Nov 22, 2024
3430047
ci: dump logs to terminal instead
sveitser Nov 22, 2024
eab37fb
ci: dump logs of process compose services
sveitser Nov 22, 2024
c51d674
script for running sequencer binaries based on flag
imabdulbasit Nov 22, 2024
ce1daff
increase blocks timeout to 180s, update query-service
imabdulbasit Nov 22, 2024
dea18a5
adjust sequencer_blocks_timeout
imabdulbasit Nov 22, 2024
993bf86
try with timeout=25
imabdulbasit Nov 22, 2024
c794446
revert timeout
imabdulbasit Nov 22, 2024
588fa38
try2
imabdulbasit Nov 22, 2024
f54c597
update query-service
imabdulbasit Nov 25, 2024
b02551a
max connections as env
imabdulbasit Nov 25, 2024
8bb8aff
wait 5s
imabdulbasit Nov 25, 2024
d9c22df
Merge branch 'main' into ab/sqlite
imabdulbasit Nov 25, 2024
cdc2fd0
update query-service to 0.1.74
imabdulbasit Nov 25, 2024
41a0799
logging
imabdulbasit Nov 25, 2024
897563f
cargo sort
imabdulbasit Nov 25, 2024
f76f668
more logging
imabdulbasit Nov 25, 2024
c5ce4cc
catchup from sequencer0
imabdulbasit Nov 25, 2024
0a73fe8
catchup from seq0
imabdulbasit Nov 25, 2024
3472669
catchup from seq5
imabdulbasit Nov 25, 2024
9aa9c4a
exit if any one of the node has seen the upgrade
imabdulbasit Nov 26, 2024
975d8ee
catchup from seq0
imabdulbasit Nov 26, 2024
4f28a44
remove test from archive in integration test
imabdulbasit Nov 26, 2024
bda2921
Upload logs as archive
sveitser Nov 26, 2024
dbbe97e
integration test: more debug output
sveitser Nov 26, 2024
6bbd9e8
use archive
imabdulbasit Nov 26, 2024
521ce89
set max connections to 3 for sqlite
imabdulbasit Nov 26, 2024
6f3479d
try with 5nodes
imabdulbasit Nov 26, 2024
c181e35
sequencer_clients
imabdulbasit Nov 26, 2024
a4577f1
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 26, 2024
d89a669
slow statement threshold
imabdulbasit Nov 26, 2024
4635c02
fix state peer
imabdulbasit Nov 26, 2024
09e0878
use embedded-db instead of all features
imabdulbasit Nov 30, 2024
16ace39
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Nov 30, 2024
6054b29
lint
imabdulbasit Nov 30, 2024
6e9d79c
make seq0 state peer for seq3
imabdulbasit Dec 1, 2024
452474b
add api peers for seq3 and seq4
imabdulbasit Dec 1, 2024
80c8637
try with only 1 sqlite node
imabdulbasit Dec 1, 2024
0574057
remove seq3 and 4 from clients
imabdulbasit Dec 1, 2024
7487faa
update docker-compose
imabdulbasit Dec 2, 2024
0040cb0
catchup from seq4, set slow_statement_threshold to 1s
imabdulbasit Dec 2, 2024
6d4e87c
Merge remote-tracking branch 'origin/main' into ab/sqlite
imabdulbasit Dec 2, 2024
b627615
pass storage-sql in the sequencer-entrypoint for sqlite
imabdulbasit Dec 2, 2024
ef72571
use sqlite sub dir
imabdulbasit Dec 2, 2024
b817446
create sqlite sub-dir if it does not exist
imabdulbasit Dec 2, 2024
72544fe
create_dir_all
imabdulbasit Dec 2, 2024
d43f9ad
set default slow threshold
imabdulbasit Dec 2, 2024
3c6da8f
fix dev node test
imabdulbasit Dec 2, 2024
90b8276
fix dockerfile
imabdulbasit Dec 4, 2024
9fee97a
Merge branch 'main' into ab/sqlite
imabdulbasit Dec 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
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,6 @@ INTEGRATION_TEST_PROTO=http
# Version of sequencer protocol we want to test. If this is set to
# `03`, marketplace upgrade will be tested.
INTEGRATION_TEST_SEQUENCER_VERSION=02

# max database connections
ESPRESSO_SEQUENCER_DATABASE_MAX_CONNECTIONS=25
4 changes: 2 additions & 2 deletions .github/workflows/benchmark-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
cargo build --locked --release --features benchmarking,testing --bin espresso-dev-node
cargo build --locked --release --features benchmarking,testing,embedded-db --bin espresso-dev-node

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
cargo build --locked --release --features benchmarking,testing --bin espresso-dev-node
cargo build --locked --release --features benchmarking,testing,embedded-db --bin espresso-dev-node

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ jobs:
# Build in release without `testing` feature, this should work without `hotshot_example` config.
run: |
cargo build --locked --release --workspace

- name: Build sequencer-sqlite
run: cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir ./target

- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
cargo build --locked --release --features testing --bin espresso-dev-node
cargo build --locked --release --features "testing embedded-db" --bin espresso-dev-node
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we explicitly specify the embedded-db features everywhere? I think in other places we are just specifying --all-features which isn't clear. Especially since we were using --all-features previously (I think).

Copy link
Contributor Author

Choose a reason for hiding this comment

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


- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -79,6 +82,7 @@ jobs:
target/release/marketplace-builder
target/release/node-metrics
target/release/dev-rollup
target/release/sequencer-sqlite

build-arm:
if: github.event_name != 'pull_request'
Expand All @@ -100,6 +104,9 @@ jobs:
run: |
cargo build --locked --release --workspace

- name: Build sequencer-sqlite
run: cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir ./target

- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
Expand Down Expand Up @@ -132,6 +139,7 @@ jobs:
target/release/marketplace-builder
target/release/node-metrics
target/release/dev-rollup
target/release/sequencer-sqlite

build-dockers:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -286,7 +294,6 @@ jobs:
with:
images: ghcr.io/espressosystems/espresso-sequencer/dev-rollup


- name: Build and push sequencer docker
uses: docker/build-push-action@v6
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:
- name: Compile all executables
# timeout-minutes: 120
run: |
nix develop $DEVSHELL --accept-flake-config --option sandbox relaxed -c cargo build --locked --release
nix develop $DEVSHELL --accept-flake-config --option sandbox relaxed -c cargo build --locked --release
-c cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir 'echo $CARGO_TARGET_DIR'

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -95,6 +96,7 @@ jobs:
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/marketplace-builder
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/node-metrics
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/dev-rollup
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/sequencer-sqlite
static-dockers:
runs-on: ubuntu-latest
needs: static-build
Expand Down Expand Up @@ -377,4 +379,4 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.dev-rollup.outputs.tags }}
labels: ${{ steps.dev-rollup.outputs.labels }}
labels: ${{ steps.dev-rollup.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/cargo-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
pull_request:
workflow_dispatch:

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ jobs:
- name: Format Check
run: cargo fmt -- --check

- name: Check
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
- name: Check (embedded-db)
Copy link
Contributor

Choose a reason for hiding this comment

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

Confused here too. Won't --all-features + --all-targets lint everything? If so, why run clippy a second time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all-features would enable the "embedded-db" feature and so this would disable any postgres code. This is because we have #[cfg(not(feature = "embedded-db")) for the postgres code. We are doing lint check second time to see that postgres lint doesn't have any error. So one clippy run would check that sqlite lint and other one checks the postgres. The features here don't add the functionality but rather deactivate one and activate the other.

Copy link
Contributor

Choose a reason for hiding this comment

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

Humm is this not addressed by having sqlite in a separate package? cargo lint --workspace would hit both the package w/ embedded-db and the other sequencer binary that does not enable that feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its not the binary we are checking. We are checking the sequencer library with embedded-db code activated and postgres disabled and vice versa

run: cargo clippy --workspace --features "embedded-db testing" --all-targets -- -D warnings

- name: Check (postgres)
run: cargo clippy --workspace --features testing --all-targets -- -D warnings
44 changes: 41 additions & 3 deletions .github/workflows/slowtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
RUST_LOG: info,libp2p=off,node=error

jobs:
slow-tests:
slow-tests-sqlite:
runs-on: ubuntu-latest
steps:
# These tests need the `anvil` binary provided by foundry
Expand All @@ -46,11 +46,49 @@ jobs:
- name: Build
run: |
cargo build --locked --bin diff-test --release
cargo nextest run --locked --release --workspace --all-features --no-run
cargo nextest run --locked --release --workspace --features embedded-db --no-run
timeout-minutes: 90

- name: Slow Test
env:
NEXTEST_PROFILE: slow
run: cargo nextest run --locked --release --workspace --all-features --verbose --no-fail-fast --nocapture
run: cargo nextest run --locked --release --workspace --features embedded-db --verbose --no-fail-fast --nocapture
timeout-minutes: 40
slow-tests-postgres:
runs-on: ubuntu-latest
steps:
- name: Fix submodule permissions check
run: |
git config --global --add safe.directory '*'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- uses: taiki-e/install-action@nextest

- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure Environment
run: PATH="$PWD/target/release:$PATH"

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true

- name: Build
run: |
cargo build --locked --bin diff-test --release
cargo nextest run --locked --release --workspace --no-run
timeout-minutes: 90

- name: Slow Test
env:
NEXTEST_PROFILE: slow
run: cargo nextest run --locked --release --workspace --verbose --no-fail-fast --nocapture
timeout-minutes: 40
115 changes: 88 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ concurrency:
env:
RUST_LOG: info,libp2p=off,node=error
CARGO_TERM_COLOR: always
# Save the process compose logs
PC_LOGS: /tmp/pc.log

jobs:
build-test-artifacts:
name: Build test artifacts
build-test-artifacts-postgres:
name: Build test artifacts (postgres)
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: rui314/setup-mold@v1
Expand All @@ -40,13 +42,40 @@ jobs:
cache-provider: buildjet

- name: Build and archive tests
run: cargo nextest archive --locked --workspace --all-features --archive-file nextest-archive.tar.zst
run: cargo nextest archive --locked --workspace --archive-file nextest-archive-postgres.tar.zst

- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst
name: nextest-archive-postgres
path: nextest-archive-postgres.tar.zst

build-test-artifacts-sqlite:
name: Build test artifacts (sqlite)
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: rui314/setup-mold@v1

- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
cache-provider: buildjet

- name: Build and archive tests
run: cargo nextest archive --locked --features "embedded-db testing" --workspace --archive-file nextest-archive-sqlite.tar.zst

- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive-sqlite
path: nextest-archive-sqlite.tar.zst

build-test-bins:
name: Build test binaries
Expand All @@ -63,7 +92,9 @@ jobs:
cache-provider: buildjet

- name: Build Bins
run: cargo build --locked --profile test --bins
run: |
cargo build --locked --profile test --bins
cargo build --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir ./target
timeout-minutes: 30

- name: Upload archive to workflow
Expand Down Expand Up @@ -93,9 +124,10 @@ jobs:
target/debug/marketplace-builder
target/debug/node-metrics
target/debug/dev-rollup
target/debug/sequencer-sqlite

test:
needs: build-test-artifacts
test-postgres:
needs: build-test-artifacts-postgres
runs-on: ubuntu-latest
steps:
- name: Install Foundry
Expand All @@ -108,25 +140,55 @@ jobs:
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive
name: nextest-archive-postgres

- name: Test
run: |
cargo nextest run --archive-file nextest-archive.tar.zst --verbose --no-fail-fast \
cargo nextest run --archive-file nextest-archive-postgres.tar.zst --verbose --no-fail-fast \
--workspace-remap $PWD
timeout-minutes: 20

test-sqlite:
needs: build-test-artifacts-sqlite
runs-on: ubuntu-latest
steps:
- name: Fix submodule permissions check
run: |
git config --global --add safe.directory '*'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive-sqlite

- name: Test
run: |
cargo nextest run --archive-file nextest-archive-sqlite.tar.zst --verbose --no-fail-fast \
--workspace-remap $PWD
timeout-minutes: 20

test-integration:
needs: [build-test-artifacts, build-test-bins]
needs: [build-test-bins, build-test-artifacts-postgres]
strategy:
matrix:
version: [02,03]
version: [02, 03]
include:
- version: 02
compose: "-f process-compose.yaml -D"
compose: "-f process-compose.yaml"

- version: 03
compose: "-f process-compose.yaml -f process-compose-mp.yml -D"
compose: "-f process-compose.yaml -f process-compose-mp.yml"
runs-on: ubuntu-latest
steps:
- name: Install Nix
Expand All @@ -144,31 +206,33 @@ jobs:

- name: Move files
run: |
mv nextest-archive/* .
mv nextest-archive-postgres/* .
mkdir -p target/debug
mv test-binaries/* target/debug
chmod -c +x target/debug/*

- name: Install process-compose
run: nix profile install nixpkgs#process-compose

- name: Pull Docker Images
run: docker compose pull || docker-compose pull

- name: Run Demo-Native ${{matrix.version}}
run: bash -x scripts/demo-native ${{matrix.compose}}
run: bash -x scripts/demo-native ${{matrix.compose}} --tui=false > ${{ env.PC_LOGS }} 2>&1 &

- name: Test Integration
env:
RUST_LOG: debug
NEXTEST_PROFILE: integration
INTEGRATION_TEST_SEQUENCER_VERSION: ${{ matrix.version }}
run: |
cargo nextest run --archive-file nextest-archive.tar.zst --verbose --no-fail-fast \
cargo nextest run --archive-file nextest-archive-postgres.tar.zst --verbose --no-fail-fast --nocapture \
--workspace-remap $PWD $(if [ "${{ matrix.version }}" == "2" ]; then echo " smoke"; fi)
timeout-minutes: 40
timeout-minutes: 10

- name: Process Compose Down
run: process-compose down
- name: Upload process compose logs
if: always()
uses: actions/upload-artifact@v4
with:
name: process-compose-logs-integration-v${{ matrix.version }}
path: ${{ env.PC_LOGS }}

demo-native:
needs: build-test-bins
Expand Down Expand Up @@ -197,6 +261,3 @@ jobs:
set -o pipefail
scripts/demo-native --tui=false &
timeout -v 600 scripts/smoke-test-demo | sed -e 's/^/smoke-test: /;'

- name: Process Compose Down
run: process-compose down
Loading
Loading