diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4388d2e707..b80c8417d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -68,12 +68,14 @@ jobs: if: needs.run_checker.outputs.run_lint_rust == 'true' steps: - uses: actions/checkout@v4 + - name: Install just + uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@master with: toolchain: nightly-2024-09-15 components: rustfmt - name: run rustfmt - run: cargo +nightly-2024-09-15 fmt --all -- --check + run: just lint rust-fmt toml: runs-on: ubuntu-22.04 diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 45549618ed..dc5d58b067 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1,5 +1,6 @@ name: Scheduled on: + workflow_dispatch: schedule: - cron: '0 0 * * *' @@ -14,3 +15,38 @@ jobs: - uses: rustsec/audit-check@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v9 + with: + # Utilize a separate token for the stale worker to avoid rate limiting + repo-token: ${{ secrets.STALE_WORKER_TOKEN }} + # This is half the number of operations allowed per hour for the + # GitHub API. + operations-per-run: 2500 + days-before-stale: 45 + days-before-close: 7 + # start with the oldest issues first, as they are most likely to be stale. + ascending: true + stale-issue-label: 'stale' + stale-pr-label: 'stale' + # Allow tagging issues in such a way that they are exempt from the stale check + exempt-issue-labels: 'ignore-stale' + exempt-pr-labels: 'ignore-stale' + # Labels to easily find issues closed because they are stale. + close-issue-label: 'closed-stale' + close-pr-label: 'closed-stale' + stale-issue-message: | + This issue is stale because it has been open 45 days with no activity. Remove stale label or this issue + be closed in 7 days. + close-issue-message: 'This issue was closed because it was stale' + stale-pr-message: | + This PR is stale because it has been open 45 days with no activity. Remove stale label or this PR will be + closed in 7 days. + close-pr-message: 'This PR was closed because it has been stale.' + # Exempt anything added to a milestone from being considered stale + exempt-all-milestones: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ebe04560b..833358ab33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -217,6 +217,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' + - name: Install just + uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.RUSTUP_TOOLCHAIN }} @@ -230,15 +232,10 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: run pedantic clippy on workspace crates run: | - cargo clippy --all-targets --all-features \ - -- --warn clippy::pedantic --warn clippy::arithmetic-side-effects \ - --warn clippy::allow_attributes --warn clippy::allow_attributes_without_reason \ - --deny warnings + just lint rust-clippy - name: run pedantic clippy on tools/protobuf-compiler run: | - cargo clippy --manifest-path tools/protobuf-compiler/Cargo.toml \ - --all-targets --all-features \ - -- --warn clippy::pedantic --deny warnings + just lint rust-clippy-tools custom-lints: runs-on: buildjet-8vcpu-ubuntu-2204 @@ -248,6 +245,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' + - name: Install just + uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@master with: # This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints @@ -266,9 +265,7 @@ jobs: run: | : # list all lint packages here to have clippy explicitly test them : # uses the same nightly installed above to work around the entry in rust-toolchain.toml - cargo +nightly-2024-09-05 clippy --all-targets --all-features \ - -p tracing_debug_field \ - -- --warn clippy::pedantic --deny warnings + just lint rust-clippy-custom - name: run dylint clippy on workspace crates env: # set the dylint driver path to the target/ directory so that it's hopefully cached by rust-cache @@ -276,7 +273,7 @@ jobs: DYLINT_RUSTFLAGS: "-D warnings" run: | mkdir -p "$DYLINT_DRIVER_PATH" - cargo dylint --all --workspace + just lint rust-dylint test: if: ${{ always() && !cancelled() }} diff --git a/Cargo.lock b/Cargo.lock index 80fefd2312..e13e63e702 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1880,8 +1880,8 @@ dependencies = [ [[package]] name = "cnidarium" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "async-trait", @@ -1909,8 +1909,8 @@ dependencies = [ [[package]] name = "cnidarium-component" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "async-trait", @@ -2454,8 +2454,8 @@ dependencies = [ [[package]] name = "decaf377-fmd" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "ark-ff 0.4.2", "ark-serialize 0.4.2", @@ -2468,8 +2468,8 @@ dependencies = [ [[package]] name = "decaf377-ka" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "ark-ff 0.4.2", "decaf377", @@ -3255,8 +3255,9 @@ dependencies = [ [[package]] name = "f4jumble" -version = "0.0.0" -source = "git+https://github.com/zcash/librustzcash?rev=2425a0869098e3b0588ccd73c42716bcf418612c#2425a0869098e3b0588ccd73c42716bcf418612c" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a83e8d7fd0c526af4aad893b7c9fe41e2699ed8a776a6c74aecdeafe05afc75" dependencies = [ "blake2b_simd 1.0.2", ] @@ -4406,6 +4407,124 @@ dependencies = [ "sha3", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -4414,12 +4533,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -5015,6 +5145,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "litrs" version = "0.4.1" @@ -5757,8 +5893,8 @@ dependencies = [ [[package]] name = "penumbra-asset" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5796,8 +5932,8 @@ dependencies = [ [[package]] name = "penumbra-ibc" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5833,8 +5969,8 @@ dependencies = [ [[package]] name = "penumbra-keys" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "aes", "anyhow", @@ -5877,8 +6013,8 @@ dependencies = [ [[package]] name = "penumbra-num" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5913,8 +6049,8 @@ dependencies = [ [[package]] name = "penumbra-proto" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "async-trait", @@ -5942,8 +6078,8 @@ dependencies = [ [[package]] name = "penumbra-sct" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5978,8 +6114,8 @@ dependencies = [ [[package]] name = "penumbra-tct" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "ark-ed-on-bls12-377", "ark-ff 0.4.2", @@ -6007,8 +6143,8 @@ dependencies = [ [[package]] name = "penumbra-tower-trace" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "futures", "hex", @@ -6029,8 +6165,8 @@ dependencies = [ [[package]] name = "penumbra-txhash" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "blake2b_simd 1.0.2", @@ -7637,6 +7773,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -7937,6 +8084,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -8538,27 +8695,12 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.13" @@ -8619,9 +8761,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -8641,6 +8783,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -9157,6 +9311,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -9191,6 +9357,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -9212,6 +9402,27 @@ dependencies = [ "syn 2.0.75", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -9232,6 +9443,28 @@ dependencies = [ "syn 2.0.75", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", +] + [[package]] name = "zstd-sys" version = "2.0.13+zstd.1.5.6" diff --git a/Cargo.toml b/Cargo.toml index bded5e96a9..33ab556fb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,9 +81,10 @@ itoa = "1.0.10" jsonrpsee = { version = "0.20" } pbjson-types = "0.6" # Note that when updating the penumbra versions, vendored types in `proto/sequencerapis/astria_vendored` may need to be updated as well. -penumbra-ibc = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7", default-features = false } -penumbra-proto = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7" } -penumbra-tower-trace = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7" } +# can update to a tagged version when https://github.com/penumbra-zone/penumbra/commit/ac7abacc9bb09503d6fd6a396bc0b6850079084e is released +penumbra-ibc = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e", default-features = false } +penumbra-proto = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e" } +penumbra-tower-trace = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e" } pin-project-lite = "0.2.13" prost = "0.12" rand = "0.8.5" diff --git a/charts/celestia-local/Chart.yaml b/charts/celestia-local/Chart.yaml index 797cb6d7da..a7c37a846d 100644 --- a/charts/celestia-local/Chart.yaml +++ b/charts/celestia-local/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.7.0 +version: 0.7.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/celestia-local/files/scripts/init-celestia-appd.sh b/charts/celestia-local/files/scripts/init-celestia-appd.sh index 80ac2bd74a..10b4945a93 100755 --- a/charts/celestia-local/files/scripts/init-celestia-appd.sh +++ b/charts/celestia-local/files/scripts/init-celestia-appd.sh @@ -62,6 +62,9 @@ sed -i'.bak' 's#"null"#"kv"#g' "${home_dir}"/config/config.toml sed -i'.bak' 's#discard_abci_responses = true#discard_abci_responses = false#g' "${home_dir}"/config/config.toml # Override the VotingPeriod from 1 week to 1 minute sed -i'.bak' 's#"604800s"#"60s"#g' "${home_dir}"/config/genesis.json +# Set the CommitTimeout to 5 second +sed -i'.bak' 's#timeout_commit = "11s"#timeout_commit = "5s"#g' "${home_dir}"/config/config.toml + if $fast; then - sed -i'.bak' 's#timeout_commit = "11s"#timeout_commit = "1s"#g' "${home_dir}"/config/config.toml + sed -i'.bak' 's#timeout_commit = "5s"#timeout_commit = "1s"#g' "${home_dir}"/config/config.toml fi diff --git a/charts/celestia-local/values.yaml b/charts/celestia-local/values.yaml index 48766020bc..68ef2a3dd3 100644 --- a/charts/celestia-local/values.yaml +++ b/charts/celestia-local/values.yaml @@ -16,7 +16,7 @@ storage: path: "/data/celestia-data" celestiaAppImage: "ghcr.io/celestiaorg/celestia-app:v2.3.1" -celestiaNodeImage: "ghcr.io/celestiaorg/celestia-node:v0.18.3-mocha" +celestiaNodeImage: "ghcr.io/celestiaorg/celestia-node:v0.20.4" podSecurityContext: runAsUser: 10001 diff --git a/charts/celestia-node/Chart.yaml b/charts/celestia-node/Chart.yaml index 296fcdca6b..331a1cf7a7 100644 --- a/charts/celestia-node/Chart.yaml +++ b/charts/celestia-node/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-faucet/Chart.yaml b/charts/evm-faucet/Chart.yaml index 88ca092515..5a02dc5855 100644 --- a/charts/evm-faucet/Chart.yaml +++ b/charts/evm-faucet/Chart.yaml @@ -16,7 +16,7 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.2 +version: 0.1.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-faucet/templates/_helper.tpl b/charts/evm-faucet/templates/_helper.tpl index 6ac61d91da..639b02d707 100644 --- a/charts/evm-faucet/templates/_helper.tpl +++ b/charts/evm-faucet/templates/_helper.tpl @@ -38,3 +38,15 @@ Return the appropriate apiVersion for ingress. {{- print "extensions/v1beta1" }} {{- end }} {{- end }} + +{{/* +Service annotations +*/}} +{{- define "evmFaucet.serviceAnnotations" }} +{{- if .Values.additionalAnnotations }} +{{ toYaml .Values.additionalAnnotations }} +{{- end }} +{{- if .Values.service.annotations }} +{{ toYaml .Values.service.annotations }} +{{- end }} +{{- end }} diff --git a/charts/evm-faucet/templates/configmap.yaml b/charts/evm-faucet/templates/configmap.yaml index abfa3034cc..a534c5b166 100644 --- a/charts/evm-faucet/templates/configmap.yaml +++ b/charts/evm-faucet/templates/configmap.yaml @@ -8,6 +8,7 @@ data: ETH_FAUCET_PORT: "{{ .Values.ports.faucet }}" ETH_FAUCET_EVM_PROVIDER_URL: "{{ tpl .Values.config.providerUrl . }}" ETH_FAUCET_AMOUNT: "{{ .Values.config.amount }}" + ETH_FAUCET_INTERVAL: "{{ .Values.config.intervalMinutes }}" {{- if not .Values.secretProvider.enabled }} ETH_FAUCET_EVM_PRIVATE_KEY: "{{ .Values.config.privateKey.devContent }}" {{- end }} diff --git a/charts/evm-faucet/templates/deployment.yaml b/charts/evm-faucet/templates/deployment.yaml index 6f6c753175..f71d689e3b 100644 --- a/charts/evm-faucet/templates/deployment.yaml +++ b/charts/evm-faucet/templates/deployment.yaml @@ -24,6 +24,7 @@ spec: - -wallet.provider=$(ETH_FAUCET_EVM_PROVIDER_URL) - -wallet.privkey=$(ETH_FAUCET_EVM_PRIVATE_KEY) - -faucet.amount=$(ETH_FAUCET_AMOUNT) + - -faucet.minutes=$(ETH_FAUCET_INTERVAL) - -proxycount=$(ETH_FAUCET_PROXYCOUNT) image: {{ .Values.images.faucet.repo }}:{{ .Values.images.faucet.tag }} imagePullPolicy: {{ .Values.images.faucet.pullPolicy }} @@ -58,6 +59,6 @@ spec: driver: secrets-store.csi.k8s.io readOnly: true volumeAttributes: - secretProviderClass: evm-faucet-private-key + secretProviderClass: faucet-private-key {{- end }} --- diff --git a/charts/evm-faucet/templates/service.yaml b/charts/evm-faucet/templates/service.yaml index c994fd66de..bdc1a0c6c4 100644 --- a/charts/evm-faucet/templates/service.yaml +++ b/charts/evm-faucet/templates/service.yaml @@ -3,6 +3,10 @@ apiVersion: v1 metadata: name: {{tpl .Values.config.rollupName . }}-evm-faucet-service namespace: {{ include "evmFaucet.namespace" . }} + {{- if or .Values.additionalAnnotations .Values.service.annotations }} + annotations: + {{- include "evmFaucet.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: {{tpl .Values.config.rollupName . }}-evm-faucet diff --git a/charts/evm-faucet/values.yaml b/charts/evm-faucet/values.yaml index 6ec6c892c2..c7362c07cf 100644 --- a/charts/evm-faucet/values.yaml +++ b/charts/evm-faucet/values.yaml @@ -27,6 +27,7 @@ config: key: token # The amount of token to give per request amount: 1 + intervalMinutes: 100 providerUrl: http://{{ .Values.config.rollupName }}-evm-service.{{ include "evmFaucet.namespace" . }}.svc.cluster.local:8545 ingress: @@ -58,3 +59,6 @@ secretProvider: ports: faucet: 8080 + +service: + annotations: {} diff --git a/charts/evm-rollup/Chart.yaml b/charts/evm-rollup/Chart.yaml index c55081c828..482a162569 100644 --- a/charts/evm-rollup/Chart.yaml +++ b/charts/evm-rollup/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-rollup/templates/configmap.yaml b/charts/evm-rollup/templates/configmap.yaml index 5a5d52ae57..bf733912bf 100644 --- a/charts/evm-rollup/templates/configmap.yaml +++ b/charts/evm-rollup/templates/configmap.yaml @@ -8,7 +8,7 @@ data: ASTRIA_CONDUCTOR_CELESTIA_NODE_HTTP_URL: "{{ .Values.config.celestia.rpc }}" ASTRIA_CONDUCTOR_EXPECTED_CELESTIA_CHAIN_ID: "{{ tpl .Values.config.conductor.celestiaChainId . }}" ASTRIA_CONDUCTOR_CELESTIA_BEARER_TOKEN: "{{ .Values.config.celestia.token }}" - ASTRIA_CONDUCTOR_CELESTIA_BLOCK_TIME_MS: "12000" + ASTRIA_CONDUCTOR_CELESTIA_BLOCK_TIME_MS: "{{ .Values.config.conductor.celestiaBlockTimeMs }}" ASTRIA_CONDUCTOR_EXECUTION_RPC_URL: "http://127.0.0.1:{{ .Values.ports.executionGRPC }}" ASTRIA_CONDUCTOR_EXECUTION_COMMIT_LEVEL: "{{ .Values.config.conductor.executionCommitLevel }}" ASTRIA_CONDUCTOR_SEQUENCER_GRPC_URL: "{{ tpl .Values.config.conductor.sequencerGrpc . }}" diff --git a/charts/evm-rollup/values.yaml b/charts/evm-rollup/values.yaml index 1f2472c022..5437e0c07d 100644 --- a/charts/evm-rollup/values.yaml +++ b/charts/evm-rollup/values.yaml @@ -172,6 +172,8 @@ config: # The expected fastest block time possible from sequencer, determines polling # rate. sequencerBlockTimeMs: 2000 + # The expected fastest block time possible from DA, determines polling rate. + celestiaBlockTimeMs: 6000 # URL path for the sequencer sequencerRpc: "" # gRPC path for the sequencer diff --git a/charts/evm-stack/Chart.lock b/charts/evm-stack/Chart.lock index 142c15567e..1e2a93851f 100644 --- a/charts/evm-stack/Chart.lock +++ b/charts/evm-stack/Chart.lock @@ -1,16 +1,16 @@ dependencies: - name: celestia-node repository: file://../celestia-node - version: 0.4.0 + version: 0.4.1 - name: evm-rollup repository: file://../evm-rollup - version: 1.0.0 + version: 1.0.1 - name: composer repository: file://../composer version: 1.0.0 - name: evm-faucet repository: file://../evm-faucet - version: 0.1.2 + version: 0.1.4 - name: evm-bridge-withdrawer repository: file://../evm-bridge-withdrawer version: 1.0.1 @@ -20,5 +20,5 @@ dependencies: - name: blockscout-stack repository: https://blockscout.github.io/helm-charts version: 1.6.8 -digest: sha256:618d0978ce1fa169bffa360010e8afeb06f21ffb7574e8a298d1d561bbcee05b -generated: "2024-11-11T13:27:42.868678+02:00" +digest: sha256:60114ff7e0e79afb1f6f4e53188b255ef2fbfcf85a0af923e758bafc6f69e015 +generated: "2024-12-23T18:30:12.119377323Z" diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index 990a8c4c53..02973c627a 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,22 +15,22 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.3 +version: 1.1.1 dependencies: - name: celestia-node - version: 0.4.0 + version: 0.4.1 repository: "file://../celestia-node" condition: celestia-node.enabled - name: evm-rollup - version: 1.0.0 + version: 1.0.1 repository: "file://../evm-rollup" - name: composer version: 1.0.0 repository: "file://../composer" condition: composer.enabled - name: evm-faucet - version: 0.1.2 + version: 0.1.4 repository: "file://../evm-faucet" condition: evm-faucet.enabled - name: evm-bridge-withdrawer @@ -46,7 +46,6 @@ dependencies: version: "1.6.8" condition: blockscout-stack.enabled - # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/charts/graph-node/Chart.yaml b/charts/graph-node/Chart.yaml index 5a866a2b8b..0a58aad89c 100644 --- a/charts/graph-node/Chart.yaml +++ b/charts/graph-node/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: graph-node description: A Helm chart for Graph Node deployment -version: 0.2.0 +version: 0.2.1 appVersion: "0.0.1" maintainers: diff --git a/charts/graph-node/templates/_helpers.tpl b/charts/graph-node/templates/_helpers.tpl index c6aba56008..d0830293a7 100644 --- a/charts/graph-node/templates/_helpers.tpl +++ b/charts/graph-node/templates/_helpers.tpl @@ -12,3 +12,24 @@ Namepsace to deploy elements into. {{- define "graphnode.namespace" -}} {{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} {{- end }} + +{{/* +Service annotations +*/}} +{{- define "graphNode.serviceAnnotations" }} +{{- if .Values.graphNode.additionalAnnotations }} +{{ toYaml .Values.graphNode.additionalAnnotations }} +{{- end }} +{{- if .Values.graphNode.service.annotations }} +{{ toYaml .Values.graphNode.service.annotations }} +{{- end }} +{{- end }} + +{{- define "ipfs.serviceAnnotations" }} +{{- if .Values.ipfs.additionalAnnotations }} +{{ toYaml .Values.ipfs.additionalAnnotations }} +{{- end }} +{{- if .Values.ipfs.service.annotations }} +{{ toYaml .Values.ipfs.service.annotations }} +{{- end }} +{{- end }} diff --git a/charts/graph-node/templates/services.yaml b/charts/graph-node/templates/services.yaml index 54613bd4ae..46dec74ce7 100644 --- a/charts/graph-node/templates/services.yaml +++ b/charts/graph-node/templates/services.yaml @@ -3,6 +3,10 @@ kind: Service metadata: name: graph-node namespace: {{ include "graphnode.namespace" . }} + {{- if or .Values.graphNode.additionalAnnotations .Values.graphNode.service.annotations }} + annotations: + {{- include "graphNode.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: graph-node @@ -28,6 +32,10 @@ kind: Service metadata: name: ipfs namespace: {{ include "graphnode.namespace" . }} + {{- if or .Values.ipfs.additionalAnnotations .Values.ipfs.service.annotations }} + annotations: + {{- include "ipfs.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: ipfs diff --git a/charts/graph-node/values.yaml b/charts/graph-node/values.yaml index 1fcb3146ea..d9572bcfdc 100644 --- a/charts/graph-node/values.yaml +++ b/charts/graph-node/values.yaml @@ -14,6 +14,8 @@ graphNode: replicas: 1 metrics: enabled: false + service: + annotations: {} ports: http: 8000 jsonRpc: 8001 @@ -41,6 +43,8 @@ ipfs: enabled: false local: true size: 5Gi + service: + annotations: {} ports: api: 5001 diff --git a/charts/hermes/Chart.yaml b/charts/hermes/Chart.yaml index d7fe9a429e..7ba9b0dcec 100644 --- a/charts/hermes/Chart.yaml +++ b/charts/hermes/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.2 +version: 0.5.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sequencer-faucet/Chart.yaml b/charts/sequencer-faucet/Chart.yaml index 7aaa81d9fe..1e985b6b5e 100644 --- a/charts/sequencer-faucet/Chart.yaml +++ b/charts/sequencer-faucet/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.9.0 +version: 0.9.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.9.0" +appVersion: "0.9.1" maintainers: - name: wafflesvonmaple diff --git a/charts/sequencer-faucet/templates/_helpers.tpl b/charts/sequencer-faucet/templates/_helpers.tpl index df67bd2833..a09b945424 100644 --- a/charts/sequencer-faucet/templates/_helpers.tpl +++ b/charts/sequencer-faucet/templates/_helpers.tpl @@ -29,4 +29,16 @@ Return the appropriate apiVersion for ingress. {{- else }} {{- print "extensions/v1beta1" }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} + +{{/* +Service annotations +*/}} +{{- define "sequencer.serviceAnnotations" }} +{{- if .Values.additionalAnnotations }} +{{ toYaml .Values.additionalAnnotations }} +{{- end }} +{{- if .Values.service.annotations }} +{{ toYaml .Values.service.annotations }} +{{- end }} +{{- end }} diff --git a/charts/sequencer-faucet/templates/service.yaml b/charts/sequencer-faucet/templates/service.yaml index 56afcaa0c4..7dcc7e6d2c 100644 --- a/charts/sequencer-faucet/templates/service.yaml +++ b/charts/sequencer-faucet/templates/service.yaml @@ -3,6 +3,10 @@ apiVersion: v1 metadata: name: sequencer-faucet-service namespace: {{ .Values.global.namespace }} + {{- if or .Values.additionalAnnotations .Values.service.annotations }} + annotations: + {{- include "sequencer.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: astria-dev-cluster diff --git a/charts/sequencer-faucet/values.yaml b/charts/sequencer-faucet/values.yaml index 0de9bdaaa7..ed31a06c44 100644 --- a/charts/sequencer-faucet/values.yaml +++ b/charts/sequencer-faucet/values.yaml @@ -55,6 +55,9 @@ secretProvider: ports: faucet: 8080 +service: + annotations: {} + ingress: enabled: true # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName diff --git a/charts/sequencer-relayer/Chart.yaml b/charts/sequencer-relayer/Chart.yaml index dab7178563..77ff6e351c 100644 --- a/charts/sequencer-relayer/Chart.yaml +++ b/charts/sequencer-relayer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sequencer-relayer/templates/configmaps.yaml b/charts/sequencer-relayer/templates/configmaps.yaml index c59838009e..97738d36e6 100644 --- a/charts/sequencer-relayer/templates/configmaps.yaml +++ b/charts/sequencer-relayer/templates/configmaps.yaml @@ -6,7 +6,7 @@ metadata: data: ASTRIA_SEQUENCER_RELAYER_LOG: "astria_sequencer_relayer=debug" ASTRIA_SEQUENCER_RELAYER_SUBMISSION_STATE_PATH: "{{ include "sequencer-relayer.storage.submissionStatePath" . }}" - ASTRIA_SEQUENCER_RELAYER_BLOCK_TIME: "1000" + ASTRIA_SEQUENCER_RELAYER_BLOCK_TIME: "{{ .Values.config.relayer.blockTimeMs }}" ASTRIA_SEQUENCER_RELAYER_COMETBFT_ENDPOINT: "{{ .Values.config.relayer.cometbftRpc }}" ASTRIA_SEQUENCER_RELAYER_SEQUENCER_GRPC_ENDPOINT: "{{ .Values.config.relayer.sequencerGrpc }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_APP_GRPC_ENDPOINT: "{{ .Values.config.relayer.celestiaAppGrpc }}" diff --git a/charts/sequencer-relayer/values.yaml b/charts/sequencer-relayer/values.yaml index ba46a53ca2..16b9494776 100644 --- a/charts/sequencer-relayer/values.yaml +++ b/charts/sequencer-relayer/values.yaml @@ -25,6 +25,7 @@ config: cometbftRpc: "" sequencerGrpc: "" onlyIncludeRollups: "" + blockTimeMs: "1000" metrics: enabled: false diff --git a/charts/sequencer/Chart.lock b/charts/sequencer/Chart.lock index 8261e7086a..057ecc9bb7 100644 --- a/charts/sequencer/Chart.lock +++ b/charts/sequencer/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: sequencer-relayer repository: file://../sequencer-relayer - version: 1.0.0 -digest: sha256:6f65d48d295fde2acca7ea368fa319add42cd33eff18ddb9768eef09ea97bf57 -generated: "2024-10-27T10:01:12.181193-07:00" + version: 1.0.1 +digest: sha256:3b3ce65ff473606fcc86027653cadd212ba45ac8b39d5806d713b48f695ad235 +generated: "2024-12-23T18:31:36.564565164Z" diff --git a/charts/sequencer/Chart.yaml b/charts/sequencer/Chart.yaml index 54b04be575..5107f393d6 100644 --- a/charts/sequencer/Chart.yaml +++ b/charts/sequencer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.1 +version: 1.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. @@ -24,7 +24,7 @@ appVersion: "1.0.0" dependencies: - name: sequencer-relayer - version: "1.0.0" + version: "1.0.1" repository: "file://../sequencer-relayer" condition: sequencer-relayer.enabled diff --git a/charts/sequencer/files/cometbft/config/config.toml b/charts/sequencer/files/cometbft/config/config.toml index b6d8ae68e1..39722993b9 100644 --- a/charts/sequencer/files/cometbft/config/config.toml +++ b/charts/sequencer/files/cometbft/config/config.toml @@ -111,7 +111,7 @@ grpc_laddr = "" # 0 - unlimited. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} # 1024 - 40 - 10 - 50 = 924 = ~900 -grpc_max_open_connections = {{ .Values.cometbft.config.grpc.maxOpenConnections }} +grpc_max_open_connections = {{ .Values.cometbft.config.grpc.maxOpenConnections }} # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool unsafe = false diff --git a/charts/sequencer/files/cometbft/config/genesis.json b/charts/sequencer/files/cometbft/config/genesis.json index f76d4f3f2d..3c2484e90d 100644 --- a/charts/sequencer/files/cometbft/config/genesis.json +++ b/charts/sequencer/files/cometbft/config/genesis.json @@ -108,7 +108,7 @@ {{- if $index }},{{- end }} { "address": {{ include "sequencer.address" $value.address }}, - "balance": {{ include "sequencer.toUint128Proto" ( toString $value.balance | replace "\"" "" ) }} + "balance": {{ include "sequencer.toUint128Proto" ( toString $value.balance | replace "\"" "" ) }} } {{- end }} ], @@ -125,20 +125,72 @@ "connect": { "marketMap": { "marketMap": { - "markets": {} + "markets": { + {{- range $index, $market := .Values.sequencer.oracle.markets }} + {{- if $index }},{{- end }} + "{{ $market.name }}": { + "providerConfigs": [ + {{- range $providerIndex, $provider := $market.providerConfigs }} + {{- if $providerIndex }},{{- end }} + { + "name": "{{ $provider.name }}", + {{- if $provider.normalizeByPair }} + "normalizeByPair": { + "Base": "{{ $provider.normalizeByPair.Base }}", + "Quote": "{{ $provider.normalizeByPair.Quote }}" + }, + {{- end }} + "offChainTicker": "{{ $provider.offChainTicker }}" + } + {{- end }} + ], + "ticker": { + "currencyPair": { + "Base": "{{ $market.ticker.currencyPair.Base }}", + "Quote": "{{ $market.ticker.currencyPair.Quote }}" + }, + "decimals": "{{ $market.ticker.decimals }}", + "enabled": {{ $market.ticker.enabled }}, + "minProviderCount": "{{ $market.ticker.minProviderCount }}" + } + } + {{- end }} + } }, "params": { - "marketAuthorities": [], - "admin": "{{ .Values.genesis.marketAdminAddress }}" + "admin": "{{ .Values.genesis.oracle.marketAdminAddress }}", + "marketAuthorities": [ + {{- range $index, $authority := .Values.genesis.oracle.marketAuthorities }} + {{- if $index }},{{- end }} + "{{ $authority }}" + {{- end }} + ] } }, "oracle": { - "currencyPairGenesis": [], - "nextId": "0" + "currencyPairGenesis": [ + {{- range $index, $genesis := .Values.sequencer.oracle.currencyPairGenesis }} + {{- if $index }},{{- end }} + { + "currencyPair": { + "Base": "{{ $genesis.currencyPair.Base }}", + "Quote": "{{ $genesis.currencyPair.Quote }}" + }, + "currencyPairPrice": { + "blockTimestamp": "{{ $genesis.currencyPairPrice.blockTimestamp }}", + "price": "{{ $genesis.currencyPairPrice.price }}" + } + {{- if $genesis.id }}, + "id": "{{ $genesis.id }}" + {{- end }} + } + {{- end }} + ], + "nextId": "{{ .Values.sequencer.oracle.nextId }}" } } - {{- end}} }, + {{- end}} "chain_id": "{{ .Values.genesis.chainId }}", "consensus_params": { "block": { @@ -158,15 +210,9 @@ "version": { "app": "0" }, - {{- if not .Values.global.dev }} - "abci": { - "vote_extensions_enable_height": "0" - } - {{- else }} "abci": { - "vote_extensions_enable_height": "1" + "vote_extensions_enable_height": "{{ .Values.genesis.consensusParams.voteExtensionsEnableHeight }}" } - {{- end}} }, "genesis_time": "{{ .Values.genesis.genesisTime }}", "initial_height": "0", diff --git a/charts/sequencer/files/scripts/markets.json b/charts/sequencer/files/scripts/markets.json new file mode 100644 index 0000000000..34990e4f36 --- /dev/null +++ b/charts/sequencer/files/scripts/markets.json @@ -0,0 +1,38 @@ +{ + "markets": { + "BTC/USD": { + "ticker": { + "currency_pair": { + "Base": "BTC", + "Quote": "USD" + }, + "decimals": 5, + "min_provider_count": 1, + "enabled": true + }, + "provider_configs": [ + { + "name": "coingecko_api", + "off_chain_ticker": "bitcoin/usd" + } + ] + }, + "ETH/USD": { + "ticker": { + "currency_pair": { + "Base": "ETH", + "Quote": "USD" + }, + "decimals": 6, + "min_provider_count": 1, + "enabled": true + }, + "provider_configs": [ + { + "name": "coingecko_api", + "off_chain_ticker": "ethereum/usd" + } + ] + } + } +} diff --git a/charts/sequencer/templates/_helpers.tpl b/charts/sequencer/templates/_helpers.tpl index 2dc1da25ab..fc2e7dd23e 100644 --- a/charts/sequencer/templates/_helpers.tpl +++ b/charts/sequencer/templates/_helpers.tpl @@ -11,6 +11,9 @@ Namepsace to deploy elements into. {{- define "cometBFT.image" -}} {{ .Values.images.cometBFT.repo }}:{{ if .Values.global.dev }}{{ .Values.images.cometBFT.devTag }}{{ else }}{{ .Values.images.cometBFT.tag }}{{ end }} {{- end }} +{{- define "connect.image" -}} +{{ .Values.images.connect.repo }}:{{ if .Values.global.dev }}{{ .Values.images.connect.devTag }}{{ else }}{{ .Values.images.connect.tag }}{{ end }} +{{- end }} {{/* Return if ingress is stable. diff --git a/charts/sequencer/templates/configmaps.yaml b/charts/sequencer/templates/configmaps.yaml index f666257a1d..e2b3a1f312 100644 --- a/charts/sequencer/templates/configmaps.yaml +++ b/charts/sequencer/templates/configmaps.yaml @@ -30,6 +30,11 @@ metadata: data: init-cometbft.sh: | {{- tpl (.Files.Get "files/scripts/init-cometbft.sh") $ | nindent 4 }} + {{- if not .Values.global.dev }} + {{- else }} + markets.json: | + {{- tpl (.Files.Get "files/scripts/markets.json") $ | nindent 4 }} + {{- end }} --- apiVersion: v1 kind: ConfigMap @@ -73,10 +78,10 @@ data: OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.sequencer.otel.otlpHeaders }}" OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.sequencer.otel.traceHeaders }}" OTEL_SERVICE_NAME: "{{ tpl .Values.sequencer.otel.serviceName . }}" - ASTRIA_SEQUENCER_ORACLE_GRPC_ADDR: "http://127.0.0.1:{{ .Values.ports.oracleGrpc }}" - ASTRIA_SEQUENCER_ORACLE_CLIENT_TIMEOUT_MILLISECONDS: "{{ .Values.sequencer.oracle.clientTimeout }}" {{- if not .Values.global.dev }} {{- else }} - ASTRIA_SEQUENCER_NO_ORACLE: "true" + ASTRIA_SEQUENCER_NO_ORACLE: "{{ not .Values.sequencer.oracle.enabled }}" + ASTRIA_SEQUENCER_ORACLE_GRPC_ADDR: "http://127.0.0.1:{{ .Values.ports.oracleGrpc }}" + ASTRIA_SEQUENCER_ORACLE_CLIENT_TIMEOUT_MILLISECONDS: "{{ .Values.sequencer.oracle.clientTimeout }}" {{- end }} --- diff --git a/charts/sequencer/templates/service.yaml b/charts/sequencer/templates/service.yaml index 9ae814b253..33c3fe3514 100644 --- a/charts/sequencer/templates/service.yaml +++ b/charts/sequencer/templates/service.yaml @@ -66,5 +66,10 @@ spec: - name: seq-metric port: {{ .Values.ports.sequencerMetrics }} targetPort: seq-metric + {{- if .Values.sequencer.oracle.metrics.enabled }} + - name: oracle-metric + port: {{ .Values.ports.oracleMetrics }} + targetPort: oracle-metric + {{- end }} {{- end }} {{- end }} diff --git a/charts/sequencer/templates/servicemonitor.yaml b/charts/sequencer/templates/servicemonitor.yaml index 5eb681a645..886ca30ffc 100644 --- a/charts/sequencer/templates/servicemonitor.yaml +++ b/charts/sequencer/templates/servicemonitor.yaml @@ -34,6 +34,16 @@ spec: {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} + {{- if .Values.sequencer.oracle.metrics.enabled }} + - port: oracle-metric + path: / + {{- with .Values.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + {{- end }} {{- end }} --- {{- end }} diff --git a/charts/sequencer/templates/statefulsets.yaml b/charts/sequencer/templates/statefulsets.yaml index 362a410f61..5fe1539c3d 100644 --- a/charts/sequencer/templates/statefulsets.yaml +++ b/charts/sequencer/templates/statefulsets.yaml @@ -94,6 +94,23 @@ spec: limits: cpu: {{ .Values.resources.cometbft.limits.cpu }} memory: {{ .Values.resources.cometbft.limits.memory }} + - name: connect + image: "{{ include "connect.image" . }}" + imagePullPolicy: {{ .Values.images.connect.pullPolicy }} + volumeMounts: + - mountPath: /scripts + name: cometbft-init-scripts-volume + command: [ "connect"] + args: + - "--market-map-endpoint" + - "127.0.0.1:{{ .Values.ports.sequencerGrpc }}" + - "--port" + - "{{ .Values.ports.oracleGrpc }}" + ports: + - containerPort: {{ .Values.ports.oracleGrpc }} + name: oracle-grpc + - containerPort: {{ .Values.ports.oracleMetrics }} + name: oracle-metric volumes: - name: cometbft-config-volume configMap: diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index 8d01e06b7d..d54ec479ab 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -24,7 +24,12 @@ images: repo: ghcr.io/astriaorg/sequencer pullPolicy: IfNotPresent tag: 1.0.0 - devTag: latest + devTag: sha-80be7eb + connect: + repo: ghcr.io/skip-mev/connect-sidecar + pullPolicy: IfNotPresent + tag: v2 + devTag: v2 moniker: "" genesis: @@ -34,7 +39,11 @@ genesis: base: "astria" ibcCompat: "astriacompat" authoritySudoAddress: "" - marketAdminAddress: "" + oracle: + marketAdminAddress: "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm" + marketAuthorities: + - "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm" + - "astria1xnlvg0rle2u6auane79t4p27g8hxnj36ja960z" allowedFeeAssets: [] # - nria ibc: @@ -54,6 +63,7 @@ genesis: maxAgeDuration: "1209600000000000" maxAgeNumBlocks: "4000000" maxBytes: "1048576" + voteExtensionsEnableHeight: "1" fees: feeChange: @@ -99,7 +109,8 @@ genesis: base: "0" multiplier: "0" - validators: [] + validators: + [] # - name: core # power: '1' # address: 091E47761C58C474534F4D414AF104A6CAF90C22 @@ -110,7 +121,11 @@ sequencer: parked: maxTxCount: 200 oracle: + enabled: true clientTimeout: 1000 + markets: [] + currencyPairGenesis: [] + metrics: enabled: false otel: @@ -279,6 +294,7 @@ ports: relayerRpc: 2450 sequencerMetrics: 9000 oracleGrpc: 8081 + oracleMetrics: 8002 # ServiceMonitor configuration serviceMonitor: @@ -302,14 +318,14 @@ alerting: release: kube-prometheus-stack namespace: monitoring rules: - - alert: Chain_Node_Down - expr: up{container="cometbft"} == 0 # Insert your query Expression - for: 1m # Rough number but should be enough to init warn - labels: - severity: critical - annotations: - summary: Chain Node is Down (instance {{ $labels.instance }}) - description: "chain node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + - alert: Chain_Node_Down + expr: up{container="cometbft"} == 0 # Insert your query Expression + for: 1m # Rough number but should be enough to init warn + labels: + severity: critical + annotations: + summary: Chain Node is Down (instance {{ $labels.instance }}) + description: "chain node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" storage: enabled: false diff --git a/crates/astria-bridge-contracts/CHANGELOG.md b/crates/astria-bridge-contracts/CHANGELOG.md index 5e821bef75..d064918d0c 100644 --- a/crates/astria-bridge-contracts/CHANGELOG.md +++ b/crates/astria-bridge-contracts/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + +### Fixed + - Read the provided contract's `decimals` function, falling back to a hardcoded value of 18 if the call fails. [#1762](https://github.com/astriaorg/astria/pull/1762) diff --git a/crates/astria-bridge-withdrawer/CHANGELOG.md b/crates/astria-bridge-withdrawer/CHANGELOG.md index e298881919..59090f4cd0 100644 --- a/crates/astria-bridge-withdrawer/CHANGELOG.md +++ b/crates/astria-bridge-withdrawer/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.1] - 2024-11-01 ### Fixed diff --git a/crates/astria-cli/CHANGELOG.md b/crates/astria-cli/CHANGELOG.md index 8bb8637b8f..7cadb8c69a 100644 --- a/crates/astria-cli/CHANGELOG.md +++ b/crates/astria-cli/CHANGELOG.md @@ -13,16 +13,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `fee-assets` subcommand to `sequencer` CLI [#1816](https://github.com/astriaorg/astria/pull/1816). -### Fixed - -- Fixed ICS20 withdrawal source when using channel with more than one - port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768) - ### Changed -- Removed default values from `--sequencer.chain-id` and `--sequencer-url` arguments +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). +- Remove default values from `--sequencer.chain-id` and `--sequencer-url` arguments [#1792](https://github.com/astriaorg/astria/pull/1792) +### Fixed + +- Fix ICS20 withdrawal source when using channel with more than one + port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768) + ## [0.5.1] - 2024-10-23 ### Added diff --git a/crates/astria-cli/src/bridge/mod.rs b/crates/astria-cli/src/bridge/mod.rs index cfa4aaaa81..fa65c0bd5a 100644 --- a/crates/astria-cli/src/bridge/mod.rs +++ b/crates/astria-cli/src/bridge/mod.rs @@ -36,8 +36,9 @@ impl Command { #[derive(Debug, Subcommand)] enum SubCommand { - /// Commands for interacting with Sequencer accounts + /// Collect withdrawals actions CollectWithdrawals(collect::Command), + /// Submit collected withdrawal actions SubmitWithdrawals(submit::Command), } diff --git a/crates/astria-cli/src/bridge/submit.rs b/crates/astria-cli/src/bridge/submit.rs index f7753b5bca..e387fce2b6 100644 --- a/crates/astria-cli/src/bridge/submit.rs +++ b/crates/astria-cli/src/bridge/submit.rs @@ -30,14 +30,19 @@ use tracing::{ #[derive(clap::Args, Debug)] pub(crate) struct Command { + /// Path to the file containing the actions to submit #[arg(long, short)] input: PathBuf, + /// Path to the file containing the signing key #[arg(long)] signing_key: PathBuf, + /// The address prefix for the sequencer account #[arg(long, default_value = "astria")] sequencer_address_prefix: String, + /// The chain ID of the sequencer #[arg(long)] sequencer_chain_id: String, + /// The URL of the sequencer rpc #[arg(long)] sequencer_url: String, } diff --git a/crates/astria-cli/src/sequencer/bridge_lock.rs b/crates/astria-cli/src/sequencer/bridge_lock.rs index a629192752..7049d9f11b 100644 --- a/crates/astria-cli/src/sequencer/bridge_lock.rs +++ b/crates/astria-cli/src/sequencer/bridge_lock.rs @@ -22,16 +22,18 @@ pub(super) struct Command { /// The amount being locked #[arg(long)] amount: u128, + /// The address on the destination chain #[arg(long)] destination_chain_address: String, /// The prefix to construct a bech32m address given the private key. #[arg(long, default_value = "astria")] prefix: String, + /// The private key of the account locking the funds + #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] // TODO: https://github.com/astriaorg/astria/issues/594 // Don't use a plain text private, prefer wrapper like from // the secrecy crate with specialized `Debug` and `Drop` implementations // that overwrite the key on drop and don't reveal it when printing. - #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node #[arg(long, env = "SEQUENCER_URL")] diff --git a/crates/astria-cli/src/sequencer/ics20_withdrawal.rs b/crates/astria-cli/src/sequencer/ics20_withdrawal.rs index 68ec8c1d72..81086f3887 100644 --- a/crates/astria-cli/src/sequencer/ics20_withdrawal.rs +++ b/crates/astria-cli/src/sequencer/ics20_withdrawal.rs @@ -60,11 +60,12 @@ pub(super) struct Command { /// The prefix to construct a bech32m address given the private key #[arg(long, default_value = "astria")] prefix: String, + /// The private key of the account withdrawing the funds + #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] // TODO: https://github.com/astriaorg/astria/issues/594 // Don't use a plain text private, prefer wrapper like from // the secrecy crate with specialized `Debug` and `Drop` implementations // that overwrite the key on drop and don't reveal it when printing. - #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node #[arg(long, env = "SEQUENCER_URL")] diff --git a/crates/astria-cli/src/sequencer/init_bridge_account.rs b/crates/astria-cli/src/sequencer/init_bridge_account.rs index 41085bc53d..34a351ca06 100644 --- a/crates/astria-cli/src/sequencer/init_bridge_account.rs +++ b/crates/astria-cli/src/sequencer/init_bridge_account.rs @@ -15,11 +15,12 @@ pub(super) struct Command { /// The bech32m prefix that will be used for constructing addresses using the private key #[arg(long, default_value = "astria")] prefix: String, + /// The private key of the account initializing the bridge account + #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] // TODO: https://github.com/astriaorg/astria/issues/594 // Don't use a plain text private, prefer wrapper like from // the secrecy crate with specialized `Debug` and `Drop` implementations // that overwrite the key on drop and don't reveal it when printing. - #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node #[arg(long, env = "SEQUENCER_URL")] diff --git a/crates/astria-cli/src/sequencer/sudo/fee_asset.rs b/crates/astria-cli/src/sequencer/sudo/fee_asset.rs index dd9a021f19..a04ff1d90a 100644 --- a/crates/astria-cli/src/sequencer/sudo/fee_asset.rs +++ b/crates/astria-cli/src/sequencer/sudo/fee_asset.rs @@ -91,11 +91,12 @@ struct ArgsInner { /// The bech32m prefix that will be used for constructing addresses using the private key #[arg(long, default_value = "astria")] prefix: String, + /// The private key of the sudo account authorizing change + #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] // TODO: https://github.com/astriaorg/astria/issues/594 // Don't use a plain text private, prefer wrapper like from // the secrecy crate with specialized `Debug` and `Drop` implementations // that overwrite the key on drop and don't reveal it when printing. - #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node #[arg(long, env = "SEQUENCER_URL")] diff --git a/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs b/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs index 263bb22597..8c546701e0 100644 --- a/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs +++ b/crates/astria-cli/src/sequencer/sudo/ibc_relayer.rs @@ -88,11 +88,12 @@ struct ArgsInner { /// The prefix to construct a bech32m address given the private key. #[arg(long, default_value = "astria")] prefix: String, + /// The private key of the account authorizing the change + #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] // TODO: https://github.com/astriaorg/astria/issues/594 // Don't use a plain text private, prefer wrapper like from // the secrecy crate with specialized `Debug` and `Drop` implementations // that overwrite the key on drop and don't reveal it when printing. - #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node #[arg(long, env = "SEQUENCER_URL")] diff --git a/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs b/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs index 147dc0afc2..d37104ba06 100644 --- a/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs +++ b/crates/astria-cli/src/sequencer/sudo/sudo_address_change.rs @@ -17,11 +17,12 @@ pub(super) struct Command { /// The bech32m prefix that will be used for constructing addresses using the private key #[arg(long, default_value = "astria")] prefix: String, + /// The private key of account authorizing the change + #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] // TODO: https://github.com/astriaorg/astria/issues/594 // Don't use a plain text private, prefer wrapper like from // the secrecy crate with specialized `Debug` and `Drop` implementations // that overwrite the key on drop and don't reveal it when printing. - #[arg(long, env = "SEQUENCER_PRIVATE_KEY")] private_key: String, /// The url of the Sequencer node #[arg(long, env = "SEQUENCER_URL")] diff --git a/crates/astria-cli/src/sequencer/threshold/dkg.rs b/crates/astria-cli/src/sequencer/threshold/dkg.rs index 8ea7295c1d..8469bbfded 100644 --- a/crates/astria-cli/src/sequencer/threshold/dkg.rs +++ b/crates/astria-cli/src/sequencer/threshold/dkg.rs @@ -48,6 +48,7 @@ pub(super) struct Command { #[arg(long)] public_key_package_path: String, + /// The address prefix for the generated address. #[arg(long, default_value = "astria")] prefix: String, } diff --git a/crates/astria-cli/src/sequencer/transfer.rs b/crates/astria-cli/src/sequencer/transfer.rs index b80c46812f..69a5036f88 100644 --- a/crates/astria-cli/src/sequencer/transfer.rs +++ b/crates/astria-cli/src/sequencer/transfer.rs @@ -17,9 +17,9 @@ use crate::utils::submit_transaction; #[derive(clap::Args, Debug)] pub(super) struct Command { - // The address of the Sequencer account to send amount to + /// The address of the Sequencer account to send amount to to_address: Address, - // The amount being sent + /// The amount being sent #[arg(long)] amount: u128, /// The bech32m prefix that will be used for constructing addresses using the private key diff --git a/crates/astria-composer/CHANGELOG.md b/crates/astria-composer/CHANGELOG.md index e430c3d066..52a945378c 100644 --- a/crates/astria-composer/CHANGELOG.md +++ b/crates/astria-composer/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.0] - 2024-10-25 ### Changed diff --git a/crates/astria-conductor/CHANGELOG.md b/crates/astria-conductor/CHANGELOG.md index eb75e304d5..b9de90e6d4 100644 --- a/crates/astria-conductor/CHANGELOG.md +++ b/crates/astria-conductor/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.0] - 2024-10-25 ### Changed diff --git a/crates/astria-core/CHANGELOG.md b/crates/astria-core/CHANGELOG.md index 4e197c6b59..af6754b342 100644 --- a/crates/astria-core/CHANGELOG.md +++ b/crates/astria-core/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Move all Astria APIs generated from the Protobuf spec from `astria_core::generated` to `astria_core::generated::astria` [#1825](https://github.com/astriaorg/astria/pull/1825). +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). ### Removed diff --git a/crates/astria-sequencer-relayer/CHANGELOG.md b/crates/astria-sequencer-relayer/CHANGELOG.md index 63d39156ac..b2afb363c8 100644 --- a/crates/astria-sequencer-relayer/CHANGELOG.md +++ b/crates/astria-sequencer-relayer/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.0] - 2024-10-25 ### Changed diff --git a/crates/astria-sequencer-relayer/src/relayer/mod.rs b/crates/astria-sequencer-relayer/src/relayer/mod.rs index e4e58e0cb7..6f7afb299c 100644 --- a/crates/astria-sequencer-relayer/src/relayer/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/mod.rs @@ -83,6 +83,9 @@ use crate::{ IncludeRollup, }; +type ForwardFut<'a> = + Fuse>>>>; + pub(crate) struct Relayer { /// A token to notify relayer that it should shut down. #[expect( @@ -172,7 +175,7 @@ impl Relayer { // future to forward a sequencer block to the celestia-submission-task. // gets set in the select-loop if the task is at capacity. let mut forward_once_free: Fuse< - BoxFuture>>, + BoxFuture>>>, > = Fuse::terminated(); self.state.set_ready(); @@ -282,9 +285,7 @@ impl Relayer { block: SequencerBlock, block_stream: &mut read::BlockStream, submitter: write::BlobSubmitterHandle, - forward: &mut Fuse< - BoxFuture>>, - >, + forward: &mut ForwardFut, ) -> eyre::Result<()> { assert!( forward.is_terminated(), @@ -292,7 +293,7 @@ impl Relayer { congested and this future is in-flight", ); - if let Err(error) = submitter.try_send(block) { + if let Err(error) = submitter.try_send(Box::new(block)) { debug!( // Just print the error directly: TrySendError has no cause chain. %error, diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index bed9880a20..aebb0debd4 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -86,7 +86,7 @@ struct StartedSubmissionAndFee { #[derive(Clone)] pub(super) struct BlobSubmitterHandle { - tx: mpsc::Sender, + tx: mpsc::Sender>, } impl BlobSubmitterHandle { @@ -95,8 +95,8 @@ impl BlobSubmitterHandle { /// This is a thin wrapper around [`mpsc::Sender::try_send`]. pub(super) fn try_send( &self, - block: SequencerBlock, - ) -> Result<(), TrySendError> { + block: Box, + ) -> Result<(), TrySendError>> { self.tx.try_send(block) } @@ -105,8 +105,8 @@ impl BlobSubmitterHandle { /// This is a thin wrapper around [`mpsc::Sender::send`]. pub(super) async fn send( &self, - block: SequencerBlock, - ) -> Result<(), SendError> { + block: Box, + ) -> Result<(), SendError>> { self.tx.send(block).await } } @@ -116,7 +116,7 @@ pub(super) struct BlobSubmitter { client_builder: CelestiaClientBuilder, /// The channel over which sequencer blocks are received. - blocks: mpsc::Receiver, + blocks: mpsc::Receiver>, /// The accumulator of all data that will be submitted to Celestia on the next submission. next_submission: NextSubmission, @@ -253,7 +253,7 @@ impl BlobSubmitter { sequencer_height = %block.height(), "skipping sequencer block as already included in previous submission" )); - } else if let Err(error) = self.add_sequencer_block_to_next_submission(block) { + } else if let Err(error) = self.add_sequencer_block_to_next_submission(*block) { break Err(error).wrap_err( "critically failed adding Sequencer block to next submission" ); diff --git a/crates/astria-sequencer/CHANGELOG.md b/crates/astria-sequencer/CHANGELOG.md index 3fffea9a55..c80e93586f 100644 --- a/crates/astria-sequencer/CHANGELOG.md +++ b/crates/astria-sequencer/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Index all event attributes [#1786](https://github.com/astriaorg/astria/pull/1786). - Consolidate action handling to single module [#1759](https://github.com/astriaorg/astria/pull/1759). - Ensure all deposit assets are trace prefixed [#1807](https://github.com/astriaorg/astria/pull/1807). +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). ## [1.0.0] - 2024-10-25 diff --git a/crates/astria-sequencer/Cargo.toml b/crates/astria-sequencer/Cargo.toml index ac140d9759..d72e2c97c5 100644 --- a/crates/astria-sequencer/Cargo.toml +++ b/crates/astria-sequencer/Cargo.toml @@ -34,7 +34,7 @@ telemetry = { package = "astria-telemetry", path = "../astria-telemetry", featur ] } borsh = { version = "1.5.1", features = ["bytes", "derive"] } -cnidarium = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7", features = [ +cnidarium = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e", features = [ "metrics", ] } ibc-proto = { version = "0.41.0", features = ["server"] } diff --git a/crates/astria-sequencer/src/accounts/component.rs b/crates/astria-sequencer/src/accounts/component.rs index c9d515ec45..b8869d4a7c 100644 --- a/crates/astria-sequencer/src/accounts/component.rs +++ b/crates/astria-sequencer/src/accounts/component.rs @@ -25,7 +25,7 @@ pub(crate) struct AccountsComponent; impl Component for AccountsComponent { type AppState = GenesisAppState; - #[instrument(name = "AccountsComponent::init_chain", skip_all)] + #[instrument(name = "AccountsComponent::init_chain", skip_all, err)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> where S: accounts::StateWriteExt + assets::StateReadExt, diff --git a/crates/astria-sequencer/src/accounts/query.rs b/crates/astria-sequencer/src/accounts/query.rs index 00c23a4095..af7d320228 100644 --- a/crates/astria-sequencer/src/accounts/query.rs +++ b/crates/astria-sequencer/src/accounts/query.rs @@ -28,7 +28,10 @@ use tendermint::{ }, block::Height, }; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use crate::{ accounts::StateReadExt as _, @@ -36,6 +39,7 @@ use crate::{ assets::StateReadExt as _, }; +#[instrument(skip_all, fields(%asset), err(level = Level::DEBUG))] async fn ibc_to_trace( state: S, asset: &asset::IbcPrefixed, @@ -47,7 +51,7 @@ async fn ibc_to_trace( .ok_or_eyre("asset not found when user has balance of it; this is a bug") } -#[instrument(skip_all, fields(%address))] +#[instrument(skip_all, fields(%address), err(level = Level::DEBUG))] async fn get_trace_prefixed_account_balances( state: &S, address: &Address, @@ -70,6 +74,7 @@ async fn get_trace_prefixed_account_balances( /// Returns a list of [`AssetBalance`]s for the provided address. `AssetBalance`s are sorted /// alphabetically by [`asset::Denom`]. +#[instrument(skip_all)] pub(crate) async fn balance_request( storage: Storage, request: request::Query, @@ -112,6 +117,7 @@ pub(crate) async fn balance_request( } } +#[instrument(skip_all)] pub(crate) async fn nonce_request( storage: Storage, request: request::Query, @@ -150,6 +156,7 @@ pub(crate) async fn nonce_request( } } +#[instrument(skip_all, fields(%height), err(level = Level::DEBUG))] async fn get_snapshot_and_height(storage: &Storage, height: Height) -> Result<(Snapshot, Height)> { let snapshot = match height.value() { 0 => storage.latest_snapshot(), @@ -173,6 +180,7 @@ async fn get_snapshot_and_height(storage: &Storage, height: Height) -> Result<(S Ok((snapshot, height)) } +#[instrument(skip_all)] async fn preprocess_request( storage: &Storage, request: &request::Query, diff --git a/crates/astria-sequencer/src/accounts/state_ext.rs b/crates/astria-sequencer/src/accounts/state_ext.rs index ff466469db..2cae372809 100644 --- a/crates/astria-sequencer/src/accounts/state_ext.rs +++ b/crates/astria-sequencer/src/accounts/state_ext.rs @@ -25,7 +25,10 @@ use cnidarium::{ }; use futures::Stream; use pin_project_lite::pin_project; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use super::storage::{ self, @@ -141,7 +144,7 @@ pub(crate) trait StateReadExt: StateRead + crate::assets::StateReadExt { } } - #[instrument(skip_all, fields(address = %address.display_address(), %asset), err)] + #[instrument(skip_all, fields(address = %address.display_address(), %asset), err(level = Level::WARN))] async fn get_account_balance<'a, TAddress, TAsset>( &self, address: &TAddress, @@ -165,7 +168,7 @@ pub(crate) trait StateReadExt: StateRead + crate::assets::StateReadExt { .wrap_err("invalid balance bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err)] async fn get_account_nonce(&self, address: &T) -> Result { let bytes = self .get_raw(&keys::nonce(address)) @@ -186,7 +189,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip_all, fields(address = %address.display_address(), %asset, balance), err)] + #[instrument(skip_all, fields(address = %address.display_address(), %asset, balance), err(level = Level::WARN))] fn put_account_balance<'a, TAddress, TAsset>( &mut self, address: &TAddress, @@ -205,7 +208,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip_all)] + #[instrument(skip_all, fields(address = %address.display_address(), nonce), err(level = Level::WARN))] fn put_account_nonce(&mut self, address: &T, nonce: u32) -> Result<()> { let bytes = StoredValue::from(storage::Nonce::from(nonce)) .serialize() @@ -214,7 +217,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount), err)] + #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount), err(level = Level::WARN))] async fn increase_balance<'a, TAddress, TAsset>( &mut self, address: &TAddress, @@ -241,7 +244,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount))] + #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount), err(level = Level::DEBUG))] async fn decrease_balance<'a, TAddress, TAsset>( &mut self, address: &TAddress, diff --git a/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs b/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs index 3be717fc61..38c61520c6 100644 --- a/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs +++ b/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs @@ -13,6 +13,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::{ @@ -36,6 +40,7 @@ impl ActionHandler for BridgeLock { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs b/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs index a69775cf5f..97f7dbaa57 100644 --- a/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs @@ -7,6 +7,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -24,6 +28,7 @@ impl ActionHandler for BridgeSudoChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs b/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs index d2362a5742..3789fa5bde 100644 --- a/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs +++ b/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs @@ -10,6 +10,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::{ @@ -28,6 +32,7 @@ use crate::{ #[async_trait] impl ActionHandler for BridgeUnlock { // TODO(https://github.com/astriaorg/astria/issues/1430): move checks to the `BridgeUnlock` parsing. + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { ensure!(self.amount > 0, "amount must be greater than zero",); ensure!(self.memo.len() <= 64, "memo must not be more than 64 bytes"); @@ -46,6 +51,7 @@ impl ActionHandler for BridgeUnlock { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs b/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs index c92161e751..fabbe3247c 100644 --- a/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs @@ -8,6 +8,10 @@ use async_trait::async_trait; use cnidarium::StateWrite; use futures::StreamExt as _; use tokio::pin; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -25,6 +29,7 @@ impl ActionHandler for FeeAssetChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> eyre::Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/fee_change.rs b/crates/astria-sequencer/src/action_handler/impls/fee_change.rs index 39a42537a4..546c757635 100644 --- a/crates/astria-sequencer/src/action_handler/impls/fee_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/fee_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -22,6 +26,7 @@ impl ActionHandler for FeeChange { /// check that the signer of the transaction is the current sudo address, /// as only that address can change the fee + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> eyre::Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs b/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs index e5de94afbe..9ddce3ea30 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -23,6 +27,7 @@ impl ActionHandler for IbcRelayerChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs b/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs index f82af648fc..487f71b4e6 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -21,6 +25,7 @@ impl ActionHandler for IbcSudoChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs b/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs index 35d1523ece..cf29705315 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs @@ -26,7 +26,6 @@ use cnidarium::{ StateRead, StateWrite, }; -use ibc_proto::ibc::apps::transfer::v2::FungibleTokenPacketData; use ibc_types::core::channel::{ ChannelId, PortId, @@ -37,6 +36,11 @@ use penumbra_ibc::component::packet::{ SendPacketWrite as _, Unchecked, }; +use penumbra_proto::core::component::ibc::v1::FungibleTokenPacketData; +use tracing::{ + instrument, + Level, +}; use crate::{ accounts::{ @@ -60,6 +64,7 @@ use crate::{ #[async_trait] impl ActionHandler for action::Ics20Withdrawal { // TODO(https://github.com/astriaorg/astria/issues/1430): move checks to the `Ics20Withdrawal` parsing. + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { ensure!(self.timeout_time() != 0, "timeout time must be non-zero",); ensure!(self.amount() > 0, "amount must be greater than zero",); @@ -95,6 +100,7 @@ impl ActionHandler for action::Ics20Withdrawal { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs b/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs index 85e05de042..fdea8cab4f 100644 --- a/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs +++ b/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs @@ -9,6 +9,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -26,6 +30,7 @@ impl ActionHandler for InitBridgeAccount { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs b/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs index 3881e221bf..23be358129 100644 --- a/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs +++ b/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs @@ -5,11 +5,16 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::action_handler::ActionHandler; #[async_trait] impl ActionHandler for RollupDataSubmission { + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { // TODO: do we want to place a maximum on the size of the data? // https://github.com/astriaorg/astria/issues/222 diff --git a/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs b/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs index 7c7cb2e5e2..eb3f4f771a 100644 --- a/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -25,6 +29,7 @@ impl ActionHandler for SudoAddressChange { /// check that the signer of the transaction is the current sudo address, /// as only that address can change the sudo address + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/transaction.rs b/crates/astria-sequencer/src/action_handler/impls/transaction.rs index 66b4a1f191..64dbbf83fc 100644 --- a/crates/astria-sequencer/src/action_handler/impls/transaction.rs +++ b/crates/astria-sequencer/src/action_handler/impls/transaction.rs @@ -18,6 +18,10 @@ use astria_eyre::{ }, }; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ accounts::{ @@ -74,6 +78,7 @@ impl std::error::Error for InvalidNonce {} #[async_trait::async_trait] impl ActionHandler for Transaction { + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { ensure!(!self.actions().is_empty(), "must have at least one action"); @@ -173,7 +178,7 @@ impl ActionHandler for Transaction { // FIXME (https://github.com/astriaorg/astria/issues/1584): because most lines come from delegating (and error wrapping) to the // individual actions. This could be tidied up by implementing `ActionHandler for Action` // and letting it delegate. - #[expect(clippy::too_many_lines, reason = "should be refactored")] + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { // Add the current signed transaction into the ephemeral state in case // downstream actions require access to it. diff --git a/crates/astria-sequencer/src/action_handler/impls/transfer.rs b/crates/astria-sequencer/src/action_handler/impls/transfer.rs index 27d955bca3..75735e8df4 100644 --- a/crates/astria-sequencer/src/action_handler/impls/transfer.rs +++ b/crates/astria-sequencer/src/action_handler/impls/transfer.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::{ @@ -23,6 +27,7 @@ impl ActionHandler for Transfer { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/validator_update.rs b/crates/astria-sequencer/src/action_handler/impls/validator_update.rs index 4bd0d72c3c..5ad1ceab06 100644 --- a/crates/astria-sequencer/src/action_handler/impls/validator_update.rs +++ b/crates/astria-sequencer/src/action_handler/impls/validator_update.rs @@ -7,6 +7,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -23,6 +27,7 @@ impl ActionHandler for ValidatorUpdate { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/address/state_ext.rs b/crates/astria-sequencer/src/address/state_ext.rs index 0f5cd5bf30..b217e80a56 100644 --- a/crates/astria-sequencer/src/address/state_ext.rs +++ b/crates/astria-sequencer/src/address/state_ext.rs @@ -16,16 +16,23 @@ use cnidarium::{ StateRead, StateWrite, }; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use super::storage::{ self, keys, }; -use crate::storage::StoredValue; +use crate::{ + accounts::AddressBytes as _, + storage::StoredValue, +}; #[async_trait] pub(crate) trait StateReadExt: StateRead { + #[instrument(skip_all, fields(address = %address.display_address()), err(level = Level::DEBUG))] async fn ensure_base_prefix(&self, address: &Address) -> Result<()> { let prefix = self .get_base_prefix() @@ -39,6 +46,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn try_base_prefixed(&self, slice: &[u8]) -> Result
{ let prefix = self .get_base_prefix() @@ -51,7 +59,7 @@ pub(crate) trait StateReadExt: StateRead { .wrap_err("failed to construct address from byte slice and state-provided base prefix") } - #[instrument(skip_all, err)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_base_prefix(&self) -> Result { let Some(bytes) = self .get_raw(keys::BASE_PREFIX) @@ -66,7 +74,7 @@ pub(crate) trait StateReadExt: StateRead { .context("invalid base prefix bytes") } - #[instrument(skip_all, err)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_ibc_compat_prefix(&self) -> Result { let Some(bytes) = self .get_raw(keys::IBC_COMPAT_PREFIX) diff --git a/crates/astria-sequencer/src/app/benchmarks.rs b/crates/astria-sequencer/src/app/benchmarks.rs index 390f650de1..d11723c18b 100644 --- a/crates/astria-sequencer/src/app/benchmarks.rs +++ b/crates/astria-sequencer/src/app/benchmarks.rs @@ -93,7 +93,7 @@ impl Fixture { } #[divan::bench(max_time = MAX_TIME)] -fn execute_transactions_prepare_proposal(bencher: divan::Bencher) { +fn prepare_proposal_tx_execution(bencher: divan::Bencher) { let runtime = tokio::runtime::Builder::new_multi_thread() .enable_all() .build() @@ -105,7 +105,7 @@ fn execute_transactions_prepare_proposal(bencher: divan::Bencher) { let (_tx_bytes, included_txs) = runtime.block_on(async { fixture .app - .execute_transactions_prepare_proposal(constraints) + .prepare_proposal_tx_execution(constraints) .await .unwrap() }); diff --git a/crates/astria-sequencer/src/app/mod.rs b/crates/astria-sequencer/src/app/mod.rs index 9ade3b419a..b53fb82cea 100644 --- a/crates/astria-sequencer/src/app/mod.rs +++ b/crates/astria-sequencer/src/app/mod.rs @@ -27,6 +27,7 @@ use astria_core::{ connect::v1::ExtendedCommitInfoWithCurrencyPairMapping as RawExtendedCommitInfoWithCurrencyPairMapping, transaction::v1 as raw, }, + primitive::v1::TRANSACTION_ID_LEN, protocol::{ abci::AbciErrorCode, connect::v1::ExtendedCommitInfoWithCurrencyPairMapping, @@ -90,6 +91,7 @@ use tracing::{ info, instrument, warn, + Level, }; pub(crate) use self::state_ext::{ @@ -275,6 +277,7 @@ pub(crate) struct App { } impl App { + #[instrument(name = "App::new", skip_all, err)] pub(crate) async fn new( snapshot: Snapshot, mempool: Mempool, @@ -310,7 +313,7 @@ impl App { }) } - #[instrument(name = "App:init_chain", skip_all)] + #[instrument(name = "App:init_chain", skip_all, err)] pub(crate) async fn init_chain( &mut self, storage: Storage, @@ -418,7 +421,7 @@ impl App { /// It puts this special "commitment" as the first transaction in a block. /// When other validators receive the block, they know the first transaction is /// supposed to be the commitment, and verifies that is it correct. - #[instrument(name = "App::prepare_proposal", skip_all)] + #[instrument(name = "App::prepare_proposal", skip_all, err(level = Level::WARN))] pub(crate) async fn prepare_proposal( &mut self, prepare_proposal: abci::request::PrepareProposal, @@ -512,7 +515,7 @@ impl App { // ignore the txs passed by cometbft in favour of our app-side mempool let (included_tx_bytes, signed_txs_included) = self - .execute_transactions_prepare_proposal(&mut block_size_constraints) + .prepare_proposal_tx_execution(&mut block_size_constraints) .await .wrap_err("failed to execute transactions")?; self.metrics @@ -545,8 +548,9 @@ impl App { #[instrument( name = "App::process_proposal", skip_all, - fields(proposer=%base64(&process_proposal.proposer_address.as_bytes()))) - ] + fields(proposer=%base64(&process_proposal.proposer_address.as_bytes())), + err(level = Level::WARN) + )] pub(crate) async fn process_proposal( &mut self, process_proposal: abci::request::ProcessProposal, @@ -678,7 +682,7 @@ impl App { .collect::>(); let tx_results = self - .execute_transactions_process_proposal(signed_txs.clone(), &mut block_size_constraints) + .process_proposal_tx_execution(signed_txs.clone(), &mut block_size_constraints) .await .wrap_err("failed to execute transactions")?; @@ -743,20 +747,24 @@ impl App { /// /// As a result, all transactions in a sequencer block are guaranteed to execute /// successfully. - #[instrument(name = "App::execute_transactions_prepare_proposal", skip_all)] - async fn execute_transactions_prepare_proposal( + #[instrument(name = "App::prepare_proposal_tx_execution", skip_all, err(level = Level::DEBUG))] + async fn prepare_proposal_tx_execution( &mut self, block_size_constraints: &mut BlockSizeConstraints, ) -> Result<(Vec, Vec)> { let mempool_len = self.mempool.len().await; debug!(mempool_len, "executing transactions from mempool"); - let mut validated_txs: Vec = Vec::new(); - let mut included_signed_txs = Vec::new(); - let mut failed_tx_count: usize = 0; - let mut execution_results = Vec::new(); - let mut excluded_txs: usize = 0; - let mut current_tx_group = Group::BundleableGeneral; + let mut proposal_info = Proposal::Prepare { + validated_txs: Vec::new(), + included_signed_txs: Vec::new(), + failed_tx_count: 0, + execution_results: Vec::new(), + excluded_txs: 0, + current_tx_group: Group::BundleableGeneral, + mempool: self.mempool.clone(), + metrics: self.metrics, + }; // get copy of transactions to execute from mempool let pending_txs = self @@ -768,122 +776,33 @@ impl App { let mut unused_count = pending_txs.len(); for (tx_hash, tx) in pending_txs { unused_count = unused_count.saturating_sub(1); - let tx_hash_base64 = telemetry::display::base64(&tx_hash).to_string(); - let bytes = tx.to_raw().encode_to_vec(); - let tx_len = bytes.len(); - info!(transaction_hash = %tx_hash_base64, "executing transaction"); - - // don't include tx if it would make the cometBFT block too large - if !block_size_constraints.cometbft_has_space(tx_len) { - self.metrics - .increment_prepare_proposal_excluded_transactions_cometbft_space(); - debug!( - transaction_hash = %tx_hash_base64, - block_size_constraints = %json(&block_size_constraints), - tx_data_bytes = tx_len, - "excluding remaining transactions: max cometBFT data limit reached" - ); - excluded_txs = excluded_txs.saturating_add(1); - // break from loop, as the block is full + if BreakOrContinue::Break + == proposal_checks_and_tx_execution( + self, + tx, + Some(tx_hash), + block_size_constraints, + &mut proposal_info, + ) + .await? + { break; } - - // check if tx's sequence data will fit into sequence block - let tx_sequence_data_bytes = tx - .unsigned_transaction() - .actions() - .iter() - .filter_map(Action::as_rollup_data_submission) - .fold(0usize, |acc, seq| acc.saturating_add(seq.data.len())); - - if !block_size_constraints.sequencer_has_space(tx_sequence_data_bytes) { - self.metrics - .increment_prepare_proposal_excluded_transactions_sequencer_space(); - debug!( - transaction_hash = %tx_hash_base64, - block_size_constraints = %json(&block_size_constraints), - tx_data_bytes = tx_sequence_data_bytes, - "excluding transaction: max block sequenced data limit reached" - ); - excluded_txs = excluded_txs.saturating_add(1); - - // continue as there might be non-sequence txs that can fit - continue; - } - - // ensure transaction's group is less than or equal to current action group - let tx_group = tx.group(); - if tx_group > current_tx_group { - debug!( - transaction_hash = %tx_hash_base64, - block_size_constraints = %json(&block_size_constraints), - "excluding transaction: group is higher priority than previously included transactions" - ); - excluded_txs = excluded_txs.saturating_add(1); - - // note: we don't remove the tx from mempool as it may be valid in the future - continue; - } - - // execute tx and store in `execution_results` list on success - match self.execute_transaction(tx.clone()).await { - Ok(events) => { - execution_results.push(ExecTxResult { - events, - ..Default::default() - }); - block_size_constraints - .sequencer_checked_add(tx_sequence_data_bytes) - .wrap_err("error growing sequencer block size")?; - block_size_constraints - .cometbft_checked_add(tx_len) - .wrap_err("error growing cometBFT block size")?; - validated_txs.push(bytes.into()); - included_signed_txs.push((*tx).clone()); - } - Err(e) => { - self.metrics - .increment_prepare_proposal_excluded_transactions_failed_execution(); - debug!( - transaction_hash = %tx_hash_base64, - error = AsRef::::as_ref(&e), - "failed to execute transaction, not including in block" - ); - - if e.downcast_ref::().is_some() { - // we don't remove the tx from mempool if it failed to execute - // due to an invalid nonce, as it may be valid in the future. - // if it's invalid due to the nonce being too low, it'll be - // removed from the mempool in `update_mempool_after_finalization`. - // - // this is important for possible out-of-order transaction - // groups fed into prepare_proposal. a transaction with a higher - // nonce might be in a higher priority group than a transaction - // from the same account wiht a lower nonce. this higher nonce - // could execute in the next block fine. - } else { - failed_tx_count = failed_tx_count.saturating_add(1); - - // remove the failing transaction from the mempool - // - // this will remove any transactions from the same sender - // as well, as the dependent nonces will not be able - // to execute - self.mempool - .remove_tx_invalid( - tx, - RemovalReason::FailedPrepareProposal(e.to_string()), - ) - .await; - } - } - } - - // update current action group to tx's action group - current_tx_group = tx_group; } + let Proposal::Prepare { + validated_txs, + included_signed_txs, + failed_tx_count, + execution_results, + excluded_txs, + .. + } = proposal_info + else { + bail!("expected `Proposal::Prepare`, received `Proposal::Process`") + }; + if failed_tx_count > 0 { info!( failed_tx_count = failed_tx_count, @@ -923,77 +842,33 @@ impl App { /// /// As a result, all transactions in a sequencer block are guaranteed to execute /// successfully. - #[instrument(name = "App::execute_transactions_process_proposal", skip_all)] - async fn execute_transactions_process_proposal( + #[instrument(name = "App::process_proposal_tx_execution", skip_all, err(level = Level::DEBUG))] + async fn process_proposal_tx_execution( &mut self, txs: Vec, block_size_constraints: &mut BlockSizeConstraints, ) -> Result> { - let mut execution_results = Vec::new(); - let mut current_tx_group = Group::BundleableGeneral; + let mut proposal_info = Proposal::Process { + execution_results: vec![], + current_tx_group: Group::BundleableGeneral, + }; for tx in txs { - let bytes = tx.to_raw().encode_to_vec(); - let tx_hash = Sha256::digest(&bytes); - let tx_len = bytes.len(); - - // check if tx's sequence data will fit into sequence block - let tx_sequence_data_bytes = tx - .unsigned_transaction() - .actions() - .iter() - .filter_map(Action::as_rollup_data_submission) - .fold(0usize, |acc, seq| acc.saturating_add(seq.data.len())); - - if !block_size_constraints.sequencer_has_space(tx_sequence_data_bytes) { - debug!( - transaction_hash = %telemetry::display::base64(&tx_hash), - block_size_constraints = %json(&block_size_constraints), - tx_data_bytes = tx_sequence_data_bytes, - "transaction error: max block sequenced data limit passed" - ); - bail!("max block sequenced data limit passed"); - } - - // ensure transaction's group is less than or equal to current action group - let tx_group = tx.group(); - if tx_group > current_tx_group { - debug!( - transaction_hash = %telemetry::display::base64(&tx_hash), - "transaction error: block has incorrect transaction group ordering" - ); - bail!("transactions have incorrect transaction group ordering"); - } - - // execute tx and store in `execution_results` list on success - match self.execute_transaction(Arc::new(tx.clone())).await { - Ok(events) => { - execution_results.push(ExecTxResult { - events, - ..Default::default() - }); - block_size_constraints - .sequencer_checked_add(tx_sequence_data_bytes) - .wrap_err("error growing sequencer block size")?; - block_size_constraints - .cometbft_checked_add(tx_len) - .wrap_err("error growing cometBFT block size")?; - } - Err(e) => { - debug!( - transaction_hash = %telemetry::display::base64(&tx_hash), - error = AsRef::::as_ref(&e), - "transaction error: failed to execute transaction" - ); - return Err(e.wrap_err("transaction failed to execute")); - } + let tx = Arc::new(tx); + if BreakOrContinue::Break + == proposal_checks_and_tx_execution( + self, + tx, + None, + block_size_constraints, + &mut proposal_info, + ) + .await? + { + break; } - - // update current action group to tx's action group - current_tx_group = tx_group; } - - Ok(execution_results) + Ok(proposal_info.execution_results()) } /// sets up the state for execution of the block's transactions. @@ -1001,7 +876,7 @@ impl App { /// /// this *must* be called anytime before a block's txs are executed, whether it's /// during the proposal phase, or finalize_block phase. - #[instrument(name = "App::pre_execute_transactions", skip_all, err)] + #[instrument(name = "App::pre_execute_transactions", skip_all, err(level = Level::WARN))] async fn pre_execute_transactions(&mut self, block_data: BlockData) -> Result<()> { let chain_id = self .state @@ -1073,7 +948,7 @@ impl App { /// `SequencerBlock`. /// /// this must be called after a block's transactions are executed. - #[instrument(name = "App::post_execute_transactions", skip_all)] + #[instrument(name = "App::post_execute_transactions", skip_all, err(level = Level::WARN))] async fn post_execute_transactions( &mut self, block_hash: Hash, @@ -1179,7 +1054,7 @@ impl App { /// /// This is called by cometbft after the block has already been /// committed by the network's consensus. - #[instrument(name = "App::finalize_block", skip_all)] + #[instrument(name = "App::finalize_block", skip_all, err)] pub(crate) async fn finalize_block( &mut self, finalize_block: abci::request::FinalizeBlock, @@ -1333,7 +1208,7 @@ impl App { Ok(finalize_block) } - #[instrument(skip_all, err)] + #[instrument(skip_all, err(level = Level::WARN))] async fn prepare_commit(&mut self, storage: Storage) -> Result { // extract the state we've built up to so we can prepare it as a `StagedWriteBatch`. let dummy_state = StateDelta::new(storage.latest_snapshot()); @@ -1370,7 +1245,7 @@ impl App { Ok(app_hash) } - #[instrument(name = "App::begin_block", skip_all)] + #[instrument(name = "App::begin_block", skip_all, err(level = Level::WARN))] async fn begin_block( &mut self, begin_block: &abci::request::BeginBlock, @@ -1412,7 +1287,7 @@ impl App { } /// Executes a signed transaction. - #[instrument(name = "App::execute_transaction", skip_all)] + #[instrument(name = "App::execute_transaction", skip_all, err(level = Level::DEBUG))] async fn execute_transaction(&mut self, signed_tx: Arc) -> Result> { signed_tx .check_stateless() @@ -1449,7 +1324,7 @@ impl App { Ok(events) } - #[instrument(name = "App::end_block", skip_all)] + #[instrument(name = "App::end_block", skip_all, err(level = Level::WARN))] async fn end_block( &mut self, height: u64, @@ -1640,3 +1515,248 @@ struct PostTransactionExecutionResult { validator_updates: Vec, consensus_param_updates: Option, } + +#[derive(PartialEq)] +enum BreakOrContinue { + Break, + Continue, +} + +enum Proposal { + Prepare { + validated_txs: Vec, + included_signed_txs: Vec, + failed_tx_count: usize, + execution_results: Vec, + excluded_txs: usize, + current_tx_group: Group, + mempool: Mempool, + metrics: &'static Metrics, + }, + Process { + execution_results: Vec, + current_tx_group: Group, + }, +} + +impl Proposal { + fn current_tx_group(&self) -> Group { + match self { + Proposal::Prepare { + current_tx_group, .. + } + | Proposal::Process { + current_tx_group, .. + } => *current_tx_group, + } + } + + fn set_current_tx_group(&mut self, group: Group) { + match self { + Proposal::Prepare { + current_tx_group, .. + } + | Proposal::Process { + current_tx_group, .. + } => *current_tx_group = group, + } + } + + fn execution_results_mut(&mut self) -> &mut Vec { + match self { + Proposal::Prepare { + execution_results, .. + } + | Proposal::Process { + execution_results, .. + } => execution_results, + } + } + + fn execution_results(self) -> Vec { + match self { + Proposal::Prepare { + execution_results, .. + } + | Proposal::Process { + execution_results, .. + } => execution_results, + } + } +} + +#[instrument(skip_all)] +async fn proposal_checks_and_tx_execution( + app: &mut App, + tx: Arc, + // `prepare_proposal_tx_execution` already has the tx hash, so we pass it in here + tx_hash: Option<[u8; TRANSACTION_ID_LEN]>, + block_size_constraints: &mut BlockSizeConstraints, + proposal_info: &mut Proposal, +) -> Result { + let tx_bytes = tx.to_raw().encode_to_vec(); + let tx_hash_base_64 = + telemetry::display::base64(tx_hash.unwrap_or_else(|| Sha256::digest(&tx_bytes).into())) + .to_string(); + let tx_len = tx_bytes.len(); + + info!(transaction_hash = %tx_hash_base_64, "executing transaction"); + + // check CometBFT size constraints for `prepare_proposal` + if let Proposal::Prepare { + metrics, + excluded_txs, + .. + } = proposal_info + { + if !block_size_constraints.cometbft_has_space(tx_len) { + metrics.increment_prepare_proposal_excluded_transactions_cometbft_space(); + debug!( + transaction_hash = %tx_hash_base_64, + block_size_constraints = %json(&block_size_constraints), + tx_data_bytes = tx_len, + "excluding remaining transactions: max cometBFT data limit reached" + ); + *excluded_txs = excluded_txs.saturating_add(1); + + // break from calling loop, as the block is full + return Ok(BreakOrContinue::Break); + } + } + + let debug_msg = match proposal_info { + Proposal::Prepare { + .. + } => "excluding transaction", + Proposal::Process { + .. + } => "transaction error", + }; + + // check sequencer size constraints + let tx_sequence_data_bytes = tx + .unsigned_transaction() + .actions() + .iter() + .filter_map(Action::as_rollup_data_submission) + .fold(0usize, |acc, seq| acc.saturating_add(seq.data.len())); + if !block_size_constraints.sequencer_has_space(tx_sequence_data_bytes) { + debug!( + transaction_hash = %tx_hash_base_64, + block_size_constraints = %json(&block_size_constraints), + tx_data_bytes = tx_sequence_data_bytes, + "{debug_msg}: max block sequenced data limit reached" + ); + match proposal_info { + Proposal::Prepare { + metrics, + excluded_txs, + .. + } => { + metrics.increment_prepare_proposal_excluded_transactions_sequencer_space(); + *excluded_txs = excluded_txs.saturating_add(1); + + // continue as there might be non-sequence txs that can fit + return Ok(BreakOrContinue::Continue); + } + Proposal::Process { + .. + } => bail!("max block sequenced data limit passed"), + }; + } + + // ensure transaction's group is less than or equal to current action group + let tx_group = tx.group(); + if tx_group > proposal_info.current_tx_group() { + debug!( + transaction_hash = %tx_hash_base_64, + "{debug_msg}: group is higher priority than previously included transactions" + ); + match proposal_info { + Proposal::Prepare { + excluded_txs, .. + } => { + *excluded_txs = excluded_txs.saturating_add(1); + return Ok(BreakOrContinue::Continue); + } + Proposal::Process { + .. + } => { + bail!("transactions have incorrect transaction group ordering"); + } + }; + } + + let execution_results = proposal_info.execution_results_mut(); + match app.execute_transaction(tx.clone()).await { + Ok(events) => { + execution_results.push(ExecTxResult { + events, + ..Default::default() + }); + block_size_constraints + .sequencer_checked_add(tx_sequence_data_bytes) + .wrap_err("error growing sequencer block size")?; + block_size_constraints + .cometbft_checked_add(tx_len) + .wrap_err("error growing cometBFT block size")?; + if let Proposal::Prepare { + validated_txs, + included_signed_txs, + .. + } = proposal_info + { + validated_txs.push(tx_bytes.into()); + included_signed_txs.push((*tx).clone()); + } + } + Err(e) => { + debug!( + transaction_hash = %tx_hash_base_64, + error = AsRef::::as_ref(&e), + "{debug_msg}: failed to execute transaction" + ); + match proposal_info { + Proposal::Prepare { + metrics, + failed_tx_count, + mempool, + .. + } => { + metrics.increment_prepare_proposal_excluded_transactions_failed_execution(); + if e.downcast_ref::().is_some() { + // we don't remove the tx from mempool if it failed to execute + // due to an invalid nonce, as it may be valid in the future. + // if it's invalid due to the nonce being too low, it'll be + // removed from the mempool in `update_mempool_after_finalization`. + // + // this is important for possible out-of-order transaction + // groups fed into prepare_proposal. a transaction with a higher + // nonce might be in a higher priority group than a transaction + // from the same account wiht a lower nonce. this higher nonce + // could execute in the next block fine. + } else { + *failed_tx_count = failed_tx_count.saturating_add(1); + + // remove the failing transaction from the mempool + // + // this will remove any transactions from the same sender + // as well, as the dependent nonces will not be able + // to execute + mempool + .remove_tx_invalid( + tx, + RemovalReason::FailedPrepareProposal(e.to_string()), + ) + .await; + } + } + Proposal::Process { + .. + } => return Err(e.wrap_err("transaction failed to execute")), + } + } + }; + proposal_info.set_current_tx_group(tx_group); + Ok(BreakOrContinue::Continue) +} diff --git a/crates/astria-sequencer/src/app/state_ext.rs b/crates/astria-sequencer/src/app/state_ext.rs index fe10b7dc1d..436147cb31 100644 --- a/crates/astria-sequencer/src/app/state_ext.rs +++ b/crates/astria-sequencer/src/app/state_ext.rs @@ -12,7 +12,10 @@ use cnidarium::{ StateWrite, }; use tendermint::Time; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use super::storage::{ self, @@ -22,7 +25,7 @@ use crate::storage::StoredValue; #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_chain_id(&self) -> Result { let Some(bytes) = self .get_raw(keys::CHAIN_ID) @@ -37,7 +40,7 @@ pub(crate) trait StateReadExt: StateRead { .wrap_err("invalid chain id bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_revision_number(&self) -> Result { let Some(bytes) = self .get_raw(keys::REVISION_NUMBER) @@ -52,7 +55,7 @@ pub(crate) trait StateReadExt: StateRead { .wrap_err("invalid revision number bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_block_height(&self) -> Result { let Some(bytes) = self .get_raw(keys::BLOCK_HEIGHT) @@ -67,7 +70,7 @@ pub(crate) trait StateReadExt: StateRead { .context("invalid block height bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_block_timestamp(&self) -> Result