Skip to content

Commit

Permalink
Merge branch 'main' into ENG-875/nonminimal_bool
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanoroshiba committed Sep 30, 2024
2 parents 3cd969e + eced579 commit 36d808c
Show file tree
Hide file tree
Showing 91 changed files with 452 additions and 248 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ jobs:
- name: run pedantic clippy on workspace crates
run: |
cargo clippy --all-targets --all-features \
-- --warn clippy::pedantic --warn clippy::arithmetic-side-effects --deny warnings
-- --warn clippy::pedantic --warn clippy::arithmetic-side-effects \
--warn clippy::allow_attributes --warn clippy::allow_attributes_without_reason \
--deny warnings
- name: run pedantic clippy on tools/protobuf-compiler
run: |
cargo clippy --manifest-path tools/protobuf-compiler/Cargo.toml \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ network. Other components of the Astria network can be found in the
[astriaorg](https://github.com/astriaorg) organization.

To run locally, we utilize a dev-cluster which can be found at
[astriaorg/dev-cluster](https://github.com/astriaorg/dev-cluster).
[astriaorg/astria/charts](https://github.com/astriaorg/astria/tree/main/charts).

To learn more about Astria, please visit [astria.org](https://astria.org).

Expand Down
19 changes: 10 additions & 9 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ just deploy astria-local

# Deploys a geth rollup chain + faucet + blockscout + ingress
# w/ defaults running against local network, along with a bridge withdawer.
# NOTE - default values can be found in `helm/rollup/values.yaml`
# NOTE - default values can be found in `../dev/values/rollup/dev.yaml`
just deploy rollup

# Deploy only the rollup chain, faucet, blockscout instance without withdrawer:
just deploy dev-rollup
# w/ custom name and id for further customization see the values file at
# `dev/values/rollup/dev.yml`
# `../dev/values/rollup/dev.yml`
just deploy dev-rollup <rollup_name> <network_id>

# Send funds into the rollup chain, by default transfers 10 RIA to the rollup
Expand Down Expand Up @@ -80,16 +78,19 @@ The default rollup faucet is available at <http://faucet.astria.localdev.me>.
If you deploy a custom faucet, it will be reachable at
`http://faucet.<rollup_name>.localdev.me`.

By default, the faucet is funded by the account that is funded during geth
genesis. This key is defined in `./evm-rollup/values.yaml` and is identical to
the key in `./evm-rollup/files/keys/private_key.txt`.
By default, no account is funded during geth genesis.
Run `just init-rollup-bridge` to fund the faucet account. This account key is
defined in `../dev/values/rollup/dev.yaml` and is identical to the key in
`./evm-rollup/files/keys/private_key.txt`.

The default sequencer faucet is available at <http://sequencer-faucet.localdev.me>.

### Blockscout

The default Blockscout app is available at <http://blockscout.astria.localdev.me>.
The default Blockscout app is available at <http://explorer.astria.localdev.me>.

If you deploy a custom Blockscout app, it will be available at
`http://blockscout.<rollup_name>.localdev.me`.
`http://explorer.<rollup_name>.localdev.me`.

### Sequencer

Expand Down
4 changes: 2 additions & 2 deletions charts/sequencer-faucet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.1
version: 0.8.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.
# It is recommended to use it with quotes.
appVersion: "0.8.0"
appVersion: "0.8.1"

maintainers:
- name: wafflesvonmaple
Expand Down
1 change: 1 addition & 0 deletions charts/sequencer-faucet/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data:
SEQUENCER_CHAIN_ID: "{{ .Values.config.sequencerChainId }}"
SEQUENCER_ADDRESS_PREFIX: "{{ .Values.config.addressPrefix }}"
SEQUENCER_NATIVE_DENOM: "{{ .Values.config.sequencerNativeDenom }}"
SEQUENCER_FAUCET_PRECISION: "{{ .Values.config.faucetPrecision }}"
{{- if not .Values.secretProvider.enabled }}
SEQUENCER_FAUCET_PRIVATE_KEY: "{{ .Values.config.fundingPrivateKey.devContent }}"
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/sequencer-faucet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
- -proxycount=$(SEQUENCER_FAUCET_PROXYCOUNT)
- -sequencer.chainId=$(SEQUENCER_CHAIN_ID)
- -bech32.prefix=$(SEQUENCER_ADDRESS_PREFIX)
- -faucet.precision=$(SEQUENCER_FAUCET_PRECISION)
envFrom:
- configMapRef:
name: sequencer-faucet-env
Expand Down
3 changes: 2 additions & 1 deletion charts/sequencer-faucet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ config:
key: token
# The amount of token to give per request
amount: 1800
faucetPrecision: 9
minutesBetweenRequests: 1440
addressPrefix: "astria"
sequencerNativeDenom: "nria"

images:
sequencerFaucet: "ghcr.io/astriaorg/seq-faucet:0.8.0"
sequencerFaucet: "ghcr.io/astriaorg/seq-faucet:0.8.1"
pullPolicy: IfNotPresent

# When deploying in a production environment should use a secret provider
Expand Down
9 changes: 7 additions & 2 deletions containerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ RUN \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;
COPY --from=builder /build/release/$TARGETBINARY /usr/local/bin/$TARGETBINARY
RUN ln -s /usr/local/bin/$TARGETBINARY /usr/local/bin/entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint"]

# HACK: Ensure that $TARGETBINARY is the binary name.
ENV TARGETBINARY=$TARGETBINARY
RUN \
printf '#!/bin/sh\nexec /usr/local/bin/$TARGETBINARY $@\n' > /usr/local/bin/entrypoint.sh; \
chmod +x /usr/local/bin/entrypoint.sh;
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
1 change: 1 addition & 0 deletions crates/astria-bridge-contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "astria-bridge-contracts"
version = "0.1.0"
edition = "2021"
rust-version = "1.81.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion crates/astria-bridge-contracts/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[rustfmt::skip]
#[allow(clippy::pedantic)]
#[expect(clippy::pedantic, clippy::allow_attributes, clippy::allow_attributes_without_reason)]
mod generated;
use std::{
borrow::Cow,
Expand Down
3 changes: 0 additions & 3 deletions crates/astria-bridge-withdrawer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub(crate) fn start(socket_addr: SocketAddr, withdrawer_state: WithdrawerState)
axum::Server::bind(&socket_addr).serve(app.into_make_service())
}

#[allow(clippy::unused_async)] // Permit because axum handlers must be async
#[instrument(skip_all)]
async fn get_healthz(State(withdrawer_state): State<WithdrawerState>) -> Healthz {
if withdrawer_state.borrow().is_healthy() {
Expand All @@ -67,7 +66,6 @@ async fn get_healthz(State(withdrawer_state): State<WithdrawerState>) -> Healthz
///
/// + there is a current sequencer height (implying a block from sequencer was received)
/// + there is a current data availability height (implying a height was received from the DA)
#[allow(clippy::unused_async)] // Permit because axum handlers must be async
#[instrument(skip_all)]
async fn get_readyz(State(withdrawer_state): State<WithdrawerState>) -> Readyz {
let is_withdrawer_online = withdrawer_state.borrow().is_ready();
Expand All @@ -78,7 +76,6 @@ async fn get_readyz(State(withdrawer_state): State<WithdrawerState>) -> Readyz {
}
}

#[allow(clippy::unused_async)] // Permit because axum handlers must be async
#[instrument(skip_all)]
async fn get_status(State(withdrawer_state): State<WithdrawerState>) -> Json<StateSnapshot> {
Json(withdrawer_state.borrow().clone())
Expand Down
12 changes: 9 additions & 3 deletions crates/astria-bridge-withdrawer/src/bridge_withdrawer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ impl BridgeWithdrawer {
self.api_server.local_addr()
}

// Panic won't happen because `startup_task` is unwraped lazily after checking if it's `Some`.
#[allow(clippy::missing_panics_doc)]
#[expect(
clippy::missing_panics_doc,
reason = "Panic won't happen because `startup_task` is unwraped lazily after checking if \
it's `Some`."
)]
pub async fn run(self) {
let Self {
shutdown_token,
Expand Down Expand Up @@ -255,7 +258,10 @@ impl BridgeWithdrawer {
}
}

#[allow(clippy::struct_field_names)] // allow: for parity with the `Shutdown` struct.
#[expect(
clippy::struct_field_names,
reason = "for parity with the `Shutdown` struct"
)]
struct TaskHandles {
api_task: JoinHandle<eyre::Result<()>>,
startup_task: Option<JoinHandle<eyre::Result<()>>>,
Expand Down
8 changes: 5 additions & 3 deletions crates/astria-bridge-withdrawer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ use serde::{
Serialize,
};

// Allowed `struct_excessive_bools` because this is used as a container
// for deserialization. Making this a builder-pattern is not actionable.
#[allow(clippy::struct_excessive_bools)]
#[expect(
clippy::struct_excessive_bools,
reason = "This is used as a container for deserialization. Making this a builder-pattern is \
not actionable"
)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
/// The single config for creating an astria-bridge service.
pub struct Config {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ use super::test_bridge_withdrawer::{
default_native_asset,
};

// allow: want the name to reflect this is a test config.
#[allow(clippy::module_name_repetitions)]
#[expect(
clippy::module_name_repetitions,
reason = "want the name to reflect this is a test config"
)]
pub struct TestEthereum {
contract_address: ethers::types::Address,
provider: Arc<Provider<Ws>>,
Expand Down Expand Up @@ -226,7 +228,10 @@ impl TestEthereumConfig {
}
}

#[allow(clippy::struct_field_names)]
#[expect(
clippy::struct_field_names,
reason = "we want struct field names to be specific"
)]
pub struct AstriaWithdrawerDeployerConfig {
pub base_chain_asset_precision: u32,
pub base_chain_bridge_address: astria_core::primitive::v1::Address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ use tonic::{

const GET_PENDING_NONCE_GRPC_NAME: &str = "get_pending_nonce";

#[allow(clippy::module_name_repetitions)]
#[expect(
clippy::module_name_repetitions,
reason = "naming is helpful for clarity here"
)]
pub struct MockSequencerServer {
_server: JoinHandle<eyre::Result<()>>,
pub(crate) mock_server: MockServer,
Expand Down
3 changes: 0 additions & 3 deletions crates/astria-bridge-withdrawer/tests/blackbox/helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// These are tests; failing with panics is ok.
#![allow(clippy::missing_panics_doc)]

mod ethereum;
mod mock_cometbft;
mod mock_sequencer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl TestBridgeWithdrawer {
}
}

#[allow(clippy::module_name_repetitions)]
#[expect(clippy::module_name_repetitions, reason = "naming is for clarity here")]
pub struct TestBridgeWithdrawerConfig {
/// Configures the rollup's withdrawal smart contract to either native or ERC20.
pub ethereum_config: TestEthereumConfig,
Expand Down
5 changes: 5 additions & 0 deletions crates/astria-bridge-withdrawer/tests/blackbox/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
clippy::missing_panics_doc,
reason = "These are tests; failing with panics is ok."
)]

use astria_core::protocol::transaction::v1alpha1::Action;
use helpers::{
assert_actions_eq,
Expand Down
1 change: 1 addition & 0 deletions crates/astria-build-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "astria-build-info"
version = "0.1.0"
edition = "2021"
rust-version = "1.81.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
8 changes: 5 additions & 3 deletions crates/astria-cli/src/cli/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ use clap::Subcommand;
use color_eyre::eyre;

/// Interact with a Sequencer node
// allow: these are one-shot variants. the size doesn't matter as they are
// passed around only once.
#[allow(clippy::large_enum_variant)]
#[expect(
clippy::large_enum_variant,
reason = "these are one-shot variants. the size doesn't matter as they are passed around only \
once"
)]
#[derive(Debug, Subcommand)]
pub(crate) enum Command {
/// Commands for interacting with Sequencer accounts
Expand Down
3 changes: 0 additions & 3 deletions crates/astria-composer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ impl IntoResponse for Readyz {
}
}

// axum does not allow non-async handlers. This attribute can be removed
// once this method contains `await` statements.
#[allow(clippy::unused_async)]
#[instrument(skip_all)]
async fn readyz(State(composer_status): State<ComposerStatus>) -> Readyz {
debug!("received readyz request");
Expand Down
8 changes: 5 additions & 3 deletions crates/astria-composer/src/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,11 @@ impl Composer {
///
/// # Panics
/// It panics if the Composer cannot set the SIGTERM listener.
// allow: it seems splitting this into smaller functions makes the code less readable due to
// the high number of params needed for these functions.
#[allow(clippy::too_many_lines)]
#[expect(
clippy::too_many_lines,
reason = "it seems splitting this into smaller functions makes the code less readable due \
to the high number of params needed for these functions"
)]
pub async fn run_until_stopped(self) -> eyre::Result<()> {
let Self {
api_server,
Expand Down
6 changes: 4 additions & 2 deletions crates/astria-composer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ use crate::rollup::{
Rollup,
};

// this is a config, may have many boolean values
#[allow(clippy::struct_excessive_bools)]
#[expect(
clippy::struct_excessive_bools,
reason = "this is a config, may have many boolean values"
)]
#[derive(Debug, Deserialize, Serialize)]
/// The high-level config for creating an astria-composer service.
pub struct Config {
Expand Down
12 changes: 8 additions & 4 deletions crates/astria-composer/src/executor/bundle_factory/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ mod bundle_factory {

// assert that the bundle factory has one bundle in the finished queue, that the factory is
// full and that err was returned
// allow: this is intended to match all possible variants
#[allow(clippy::match_wildcard_for_single_variants)]
#[expect(
clippy::match_wildcard_for_single_variants,
reason = "this is intended to match all possible variants"
)]
match err {
BundleFactoryError::FinishedQueueFull(_) => {}
other => panic!("expected a FinishedQueueFull variant, but got {other:?}"),
Expand Down Expand Up @@ -211,8 +213,10 @@ mod bundle_factory {

// assert that the bundle factory has one bundle in the finished queue, that the factory is
// full and that err was returned
// allow: this is intended to match all possible variants
#[allow(clippy::match_wildcard_for_single_variants)]
#[expect(
clippy::match_wildcard_for_single_variants,
reason = "this is intended to match all possible variants"
)]
match err {
BundleFactoryError::FinishedQueueFull(_) => {}
other => panic!("expected a FinishedQueueFull variant, but got {other:?}"),
Expand Down
3 changes: 2 additions & 1 deletion crates/astria-composer/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ pin_project! {
impl Future for SubmitFut {
type Output = eyre::Result<u32>;

#[allow(clippy::too_many_lines)]
// FIXME (https://github.com/astriaorg/astria/issues/1572): This function is too long and should be refactored.
#[expect(clippy::too_many_lines, reason = "this may warrant a refactor")]
fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {
const INVALID_NONCE: Code = Code::Err(AbciErrorCode::INVALID_NONCE.value());
loop {
Expand Down
16 changes: 10 additions & 6 deletions crates/astria-conductor/src/celestia/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,11 @@ impl RateLimitedVerificationClient {
mut self,
height: SequencerHeight,
) -> Result<Box<tendermint_rpc::endpoint::commit::Response>, BoxError> {
// allow: it is desired that the wildcard matches all future added variants because
// this call must only return a single specific variant, panicking otherwise.
#[allow(clippy::match_wildcard_for_single_variants)]
#[expect(
clippy::match_wildcard_for_single_variants,
reason = "it is desired that the wildcard matches all future added variants because \
this call must only return a single specific variant, panicking otherwise"
)]
match self
.inner
.ready()
Expand All @@ -479,9 +481,11 @@ impl RateLimitedVerificationClient {
prev_height: SequencerHeight,
height: SequencerHeight,
) -> Result<Box<tendermint_rpc::endpoint::validators::Response>, BoxError> {
// allow: it is desired that the wildcard matches all future added variants because
// this call must only return a single specific variant, panicking otherwise.
#[allow(clippy::match_wildcard_for_single_variants)]
#[expect(
clippy::match_wildcard_for_single_variants,
reason = "it is desired that the wildcard matches all future added variants because \
this call must only return a single specific variant, panicking otherwise"
)]
match self
.inner
.ready()
Expand Down
Loading

0 comments on commit 36d808c

Please sign in to comment.