Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(proto, conductor, cd)!: changes for Forma migration #1843

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions charts/evm-rollup/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: 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
appVersion: "1.0.1"

maintainers:
- name: wafflesvonmaple
Expand Down
2 changes: 0 additions & 2 deletions charts/evm-rollup/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ metadata:
data:
ASTRIA_CONDUCTOR_LOG: "astria_conductor={{ .Values.config.logLevel }}"
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_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 . }}"
ASTRIA_CONDUCTOR_SEQUENCER_COMETBFT_URL: "{{ tpl .Values.config.conductor.sequencerRpc . }}"
ASTRIA_CONDUCTOR_EXPECTED_SEQUENCER_CHAIN_ID: "{{ tpl .Values.config.conductor.sequencerChainId . }}"
ASTRIA_CONDUCTOR_SEQUENCER_BLOCK_TIME_MS: "{{ .Values.config.conductor.sequencerBlockTimeMs }}"
ASTRIA_CONDUCTOR_NO_METRICS: "{{ not .Values.metrics.enabled }}"
ASTRIA_CONDUCTOR_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.conductorMetrics }}"
Expand Down
8 changes: 2 additions & 6 deletions charts/evm-rollup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ images:
repo: ghcr.io/astriaorg/astria-geth
pullPolicy: IfNotPresent
tag: 1.0.0
devTag: latest
devTag: pr-59
overrideTag: ""
conductor:
repo: ghcr.io/astriaorg/conductor
pullPolicy: IfNotPresent
tag: 1.0.0
tag: 1.0.1
devTag: latest


Expand Down Expand Up @@ -167,8 +167,6 @@ config:
# - "FirmOnly" -> blocks are only pulled from DA
# - "SoftAndFirm" -> blocks are pulled from both the sequencer and DA
executionCommitLevel: 'SoftAndFirm'
# The chain id of the Astria sequencer chain conductor communicates with
sequencerChainId: ""
# The expected fastest block time possible from sequencer, determines polling
# rate.
sequencerBlockTimeMs: 2000
Expand All @@ -178,8 +176,6 @@ config:
sequencerGrpc: ""
# The maximum number of requests to make to the sequencer per second
sequencerRequestsPerSecond: 500
# The chain id of the celestia network the conductor communicates with
celestiaChainId: ""

celestia:
# if config.rollup.executionLevel is NOT 'SoftOnly' AND celestia-node is not enabled
Expand Down
6 changes: 3 additions & 3 deletions charts/evm-stack/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies:
version: 0.4.0
- name: evm-rollup
repository: file://../evm-rollup
version: 1.0.0
version: 1.0.1
- name: composer
repository: file://../composer
version: 1.0.0
Expand All @@ -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:b24083a75d7242a95b7b98176e67e429c30fb33192769252f40555077034e244
generated: "2024-12-03T13:26:17.431846-06:00"
4 changes: 2 additions & 2 deletions charts/evm-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ 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.0.4

dependencies:
- name: celestia-node
version: 0.4.0
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
Expand Down
3 changes: 0 additions & 3 deletions charts/evm-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ global:
rollupName: ""
evmChainId: ""
sequencerChainId: ""
celestiaChainId: ""
otel:
endpoint: ""
tracesEndpoint: ""
Expand All @@ -29,8 +28,6 @@ evm-rollup:
chainId: "{{ .Values.global.evmChainId }}"
config:
conductor:
sequencerChainId: "{{ .Values.global.sequencerChainId }}"
celestiaChainId: "{{ .Values.global.celestiaChainId }}"
sequencerRpc: "{{ .Values.global.sequencerRpc }}"
sequencerGrpc: "{{ .Values.global.sequencerGrpc }}"
otel:
Expand Down
2 changes: 2 additions & 0 deletions crates/astria-conductor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Add stop height logic, remove chain id env vars, accomodate new genesis info
shape [#1843](https://github.com/astriaorg/astria/pull/1843).
- Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740).

## [1.0.0-rc.2] - 2024-10-23
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]

Check warning on line 1 in crates/astria-conductor/Cargo.toml

View workflow job for this annotation

GitHub Actions / conductor / rust-version-release

New Conductor Release

This PR updates the version of conductor. After merging a new release 1.0.1 will be created with tag conductor-v1.0.1.
name = "astria-conductor"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
rust-version = "1.81.0"
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 0 additions & 6 deletions crates/astria-conductor/local.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ ASTRIA_CONDUCTOR_SEQUENCER_BLOCK_TIME_MS=2000
# CometBFT node.
ASTRIA_CONDUCTOR_SEQUENCER_REQUESTS_PER_SECOND=500

# The chain ID of the sequencer network the conductor should be communicating with.
ASTRIA_CONDUCTOR_EXPECTED_SEQUENCER_CHAIN_ID="test-sequencer-1000"

# The chain ID of the Celestia network the conductor should be communicating with.
ASTRIA_CONDUCTOR_EXPECTED_CELESTIA_CHAIN_ID="test-celestia-1000"

# Set to true to enable prometheus metrics.
ASTRIA_CONDUCTOR_NO_METRICS=true

Expand Down
6 changes: 0 additions & 6 deletions crates/astria-conductor/src/celestia/builder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Boilerplate to construct a [`super::Reader`] via a type-state builder.

Check warning on line 1 in crates/astria-conductor/src/celestia/builder.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.

use std::time::Duration;

Expand All @@ -23,8 +23,6 @@
pub(crate) executor: executor::Handle,
pub(crate) sequencer_cometbft_client: SequencerClient,
pub(crate) sequencer_requests_per_second: u32,
pub(crate) expected_celestia_chain_id: String,
pub(crate) expected_sequencer_chain_id: String,
pub(crate) shutdown: CancellationToken,
pub(crate) metrics: &'static Metrics,
}
Expand All @@ -39,8 +37,6 @@
executor,
sequencer_cometbft_client,
sequencer_requests_per_second,
expected_celestia_chain_id,
expected_sequencer_chain_id,
shutdown,
metrics,
} = self;
Expand All @@ -54,8 +50,6 @@
executor,
sequencer_cometbft_client,
sequencer_requests_per_second,
expected_celestia_chain_id,
expected_sequencer_chain_id,
shutdown,
metrics,
})
Expand Down
34 changes: 14 additions & 20 deletions crates/astria-conductor/src/celestia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{

Check warning on line 1 in crates/astria-conductor/src/celestia/mod.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.
cmp::max,
sync::Arc,
time::Duration,
Expand Down Expand Up @@ -141,12 +141,6 @@
/// (usually to verify block data retrieved from Celestia blobs).
sequencer_requests_per_second: u32,

/// The chain ID of the Celestia network the reader should be communicating with.
expected_celestia_chain_id: String,

/// The chain ID of the Sequencer the reader should be communicating with.
expected_sequencer_chain_id: String,

/// Token to listen for Conductor being shut down.
shutdown: CancellationToken,

Expand Down Expand Up @@ -178,45 +172,45 @@
async fn initialize(
&mut self,
) -> eyre::Result<((), executor::Handle<StateIsInit>, tendermint::chain::Id)> {
ethanoroshiba marked this conversation as resolved.
Show resolved Hide resolved
let executor = self
.executor
.wait_for_init()
.await
.wrap_err("handle to executor failed while waiting for it being initialized")?;

let validate_celestia_chain_id = async {
let actual_celestia_chain_id = get_celestia_chain_id(&self.celestia_client)
.await
.wrap_err("failed to fetch Celestia chain ID")?;
let expected_celestia_chain_id = &self.expected_celestia_chain_id;
let expected_celestia_chain_id = executor.celestia_chain_id();
ensure!(
self.expected_celestia_chain_id == actual_celestia_chain_id.as_str(),
expected_celestia_chain_id == actual_celestia_chain_id.as_str(),
"expected Celestia chain id `{expected_celestia_chain_id}` does not match actual: \
`{actual_celestia_chain_id}`"
);
Ok(())
};

let wait_for_init_executor = async {
self.executor
.wait_for_init()
.await
.wrap_err("handle to executor failed while waiting for it being initialized")
};

let get_and_validate_sequencer_chain_id = async {
let actual_sequencer_chain_id =
get_sequencer_chain_id(self.sequencer_cometbft_client.clone())
.await
.wrap_err("failed to get sequencer chain ID")?;
let expected_sequencer_chain_id = &self.expected_sequencer_chain_id;
let expected_sequencer_chain_id = executor.sequencer_chain_id();
ensure!(
self.expected_sequencer_chain_id == actual_sequencer_chain_id.to_string(),
expected_sequencer_chain_id == actual_sequencer_chain_id.to_string(),
ethanoroshiba marked this conversation as resolved.
Show resolved Hide resolved
"expected Celestia chain id `{expected_sequencer_chain_id}` does not match \
actual: `{actual_sequencer_chain_id}`"
);
Ok(actual_sequencer_chain_id)
};

try_join!(
let ((), sequencer_chain_id) = try_join!(
validate_celestia_chain_id,
wait_for_init_executor,
get_and_validate_sequencer_chain_id
)
)?;

Ok(((), executor, sequencer_chain_id))
}
}

Expand Down
20 changes: 17 additions & 3 deletions crates/astria-conductor/src/conductor/inner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{

Check warning on line 1 in crates/astria-conductor/src/conductor/inner.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.
future::Future,
time::Duration,
};
Expand Down Expand Up @@ -28,6 +28,7 @@
warn,
};

use self::executor::StopHeightExceded;
use crate::{
celestia,
executor,
Expand Down Expand Up @@ -133,7 +134,6 @@
sequencer_grpc_client,
sequencer_cometbft_client: sequencer_cometbft_client.clone(),
sequencer_block_time: Duration::from_millis(cfg.sequencer_block_time_ms),
expected_sequencer_chain_id: cfg.expected_sequencer_chain_id.clone(),
shutdown: shutdown_token.clone(),
executor: executor_handle.clone(),
}
Expand All @@ -155,8 +155,6 @@
executor: executor_handle.clone(),
sequencer_cometbft_client: sequencer_cometbft_client.clone(),
sequencer_requests_per_second: cfg.sequencer_requests_per_second,
expected_celestia_chain_id: cfg.expected_celestia_chain_id,
expected_sequencer_chain_id: cfg.expected_sequencer_chain_id,
shutdown: shutdown_token.clone(),
metrics,
}
Expand Down Expand Up @@ -311,6 +309,8 @@
if status.code() == tonic::Code::PermissionDenied {
return true;
}
} else if err.downcast_ref::<StopHeightExceded>().is_some() {
return true;
}
current = err.source();
}
Expand All @@ -329,5 +329,19 @@
let err = err.wrap_err("wrapper_2");
let err = err.wrap_err("wrapper_3");
assert!(super::check_for_restart("executor", &err.unwrap_err()));

let celestia_height_error: Result<&str, super::StopHeightExceded> =
Err(super::StopHeightExceded::Celestia);
let err = celestia_height_error.wrap_err("wrapper_1");
let err = err.wrap_err("wrapper_2");
let err = err.wrap_err("wrapper_3");
assert!(super::check_for_restart("executor", &err.unwrap_err()));

let sequencer_height_error: Result<&str, super::StopHeightExceded> =
Err(super::StopHeightExceded::Sequencer);
let err = sequencer_height_error.wrap_err("wrapper_1");
let err = err.wrap_err("wrapper_2");
let err = err.wrap_err("wrapper_3");
assert!(super::check_for_restart("executor", &err.unwrap_err()));
}
}
6 changes: 0 additions & 6 deletions crates/astria-conductor/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The conductor configuration.

Check warning on line 1 in crates/astria-conductor/src/config.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.

use serde::{
Deserialize,
Expand Down Expand Up @@ -63,12 +63,6 @@
/// The number of requests per second that will be sent to Sequencer.
pub sequencer_requests_per_second: u32,

/// The chain ID of the sequencer network the conductor should be communiacting with.
pub expected_sequencer_chain_id: String,

/// The chain ID of the Celestia network the conductor should be communicating with.
pub expected_celestia_chain_id: String,

/// Address of the RPC server for execution
pub execution_rpc_url: String,

Expand Down
Loading
Loading