Skip to content

Commit

Permalink
delete instead of fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilyjjo committed Oct 9, 2024
1 parent 368715b commit cfbf479
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 681 deletions.
2 changes: 1 addition & 1 deletion charts/composer/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data:
ASTRIA_COMPOSER_API_LISTEN_ADDR: "0.0.0.0:{{ .Values.ports.healthApi }}"
ASTRIA_COMPOSER_GRPC_ADDR: "0.0.0.0:{{ .Values.ports.grpc }}"
ASTRIA_COMPOSER_SEQUENCER_CHAIN_ID: "{{ tpl .Values.config.sequencerChainId . }}"
ASTRIA_COMPOSER_SEQUENCER_HTTP_URL: "{{ tpl .Values.config.sequencerRpc . }}"
ASTRIA_COMPOSER_COMETBFT_ENDPOINT: "{{ tpl .Values.config.sequencerRpc . }}"
ASTRIA_COMPOSER_SEQUENCER_GRPC_URL: "{{ tpl .Values.config.sequencerGrpc . }}"
ASTRIA_COMPOSER_ROLLUPS: "{{ include "composer.rollups" . }}"
ASTRIA_COMPOSER_PRIVATE_KEY_FILE: "/var/secrets/{{ .Values.config.privateKey.secret.filename }}"
Expand Down
6 changes: 3 additions & 3 deletions charts/composer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ global:

images:
composer:
repo: ghcr.io/astriaorg/astria-composer
repo: ghcr.io/astriaorg/composer
pullPolicy: IfNotPresent
tag: "0.8.4"
devTag: local
tag: "0.8.3"
devTag: latest

config:
logLevel: "debug"
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-composer/local.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NO_COLOR=
ASTRIA_COMPOSER_API_LISTEN_ADDR="0.0.0.0:0"

# Address of the RPC server for the sequencer chain
ASTRIA_COMPOSER_SEQUENCER_HTTP_URL="http://127.0.0.1:26657"
ASTRIA_COMPOSER_COMETBFT_URL="http://127.0.0.1:26657"

# Address of the RPC server for the sequencer chain
ASTRIA_COMPOSER_SEQUENCER_GRPC_URL="http://127.0.0.1:8080"
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-composer/src/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Composer {
let shutdown_token = CancellationToken::new();

let (executor, executor_handle) = executor::Builder {
sequencer_http_url: cfg.sequencer_http_url.clone(),
cometbft_url: cfg.cometbft_url.clone(),
sequencer_grpc_url: cfg.sequencer_grpc_url.clone(),
sequencer_chain_id: cfg.sequencer_chain_id.clone(),
private_key_file: cfg.private_key_file.clone(),
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-composer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct Config {
pub api_listen_addr: SocketAddr,

/// Address of the RPC server for the sequencer chain
pub sequencer_http_url: String,
pub cometbft_url: String,

/// Address of the GRPC server for the sequencer chain
pub sequencer_grpc_url: String,
Expand Down
8 changes: 4 additions & 4 deletions crates/astria-composer/src/executor/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
};

pub(crate) struct Builder {
pub(crate) sequencer_http_url: String,
pub(crate) cometbft_url: String,
pub(crate) sequencer_grpc_url: String,
pub(crate) sequencer_chain_id: String,
pub(crate) private_key_file: String,
Expand All @@ -41,7 +41,7 @@ pub(crate) struct Builder {
impl Builder {
pub(crate) fn build(self) -> eyre::Result<(super::Executor, executor::Handle)> {
let Self {
sequencer_http_url,
cometbft_url,
sequencer_grpc_url,
sequencer_chain_id,
private_key_file,
Expand All @@ -52,7 +52,7 @@ impl Builder {
shutdown_token,
metrics,
} = self;
let sequencer_http_client = sequencer_client::HttpClient::new(sequencer_http_url.as_str())
let cometbft_client = sequencer_client::HttpClient::new(cometbft_url.as_str())
.wrap_err("failed constructing sequencer http client")?;

let sequencer_grpc_client = connect_sequencer_grpc(sequencer_grpc_url.as_str())
Expand All @@ -79,7 +79,7 @@ impl Builder {
super::Executor {
status,
serialized_rollup_transactions: serialized_rollup_transaction_rx,
sequencer_http_client,
cometbft_client,
sequencer_grpc_client,
sequencer_chain_id,
sequencer_key,
Expand Down
22 changes: 9 additions & 13 deletions crates/astria-composer/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ use crate::{
mod bundle_factory;

pub(crate) mod builder;
#[cfg(test)]
mod tests;

pub(crate) use builder::Builder;

Expand Down Expand Up @@ -131,7 +129,7 @@ pub(super) struct Executor {
serialized_rollup_transactions: mpsc::Receiver<Sequence>,
// The client for submitting wrapped and signed pending eth transactions to the astria
// sequencer via the cometbft client.
sequencer_http_client: sequencer_client::HttpClient,
cometbft_client: sequencer_client::HttpClient,
// The grpc client for grabbing the latest nonce from.
sequencer_grpc_client: sequencer_service_client::SequencerServiceClient<Channel>,
// The chain id used for submission of transactions to the sequencer.
Expand Down Expand Up @@ -207,7 +205,7 @@ impl Executor {
metrics: &'static Metrics,
) -> Fuse<Instrumented<SubmitFut>> {
SubmitFut {
sequencer_http_client: self.sequencer_http_client.clone(),
cometbft_client: self.cometbft_client.clone(),
sequencer_grpc_client: self.sequencer_grpc_client.clone(),
address: self.address,
nonce,
Expand Down Expand Up @@ -394,7 +392,7 @@ impl Executor {
},
);
let client_genesis: tendermint::Genesis =
tryhard::retry_fn(|| self.sequencer_http_client.genesis())
tryhard::retry_fn(|| self.cometbft_client.genesis())
.with_config(retry_config)
.await?;
Ok(client_genesis.chain_id)
Expand Down Expand Up @@ -521,7 +519,7 @@ async fn get_pending_nonce(
})
.with_config(retry_config)
.await
.wrap_err("failed getting pending nonce from sequencing after 1024 attempts");
.wrap_err("failed getting pending nonce from sequencer after 1024 attempts");

metrics.record_nonce_fetch_latency(start.elapsed());

Expand All @@ -538,7 +536,7 @@ async fn get_pending_nonce(
err,
)]
async fn submit_tx(
sequencer_http_client: sequencer_client::HttpClient,
cometbft_client: sequencer_client::HttpClient,
tx: SignedTransaction,
metrics: &Metrics,
) -> eyre::Result<tx_sync::Response> {
Expand Down Expand Up @@ -573,7 +571,7 @@ async fn submit_tx(
},
);
let res = tryhard::retry_fn(|| {
let client = sequencer_http_client.clone();
let client = cometbft_client.clone();
let tx = tx.clone();
let span = info_span!(parent: span.clone(), "attempt send");
async move { client.submit_transaction_sync(tx).await }.instrument(span)
Expand Down Expand Up @@ -658,7 +656,7 @@ pin_project! {
/// If the sequencer returned a non-zero abci code (albeit not `INVALID_NONCE`), this future will return with
/// that nonce it used to submit the non-zero abci code request.
struct SubmitFut {
sequencer_http_client: sequencer_client::HttpClient,
cometbft_client: sequencer_client::HttpClient,
sequencer_grpc_client: SequencerServiceClient<tonic::transport::Channel>,
address: Address,
chain_id: String,
Expand Down Expand Up @@ -710,8 +708,7 @@ impl Future for SubmitFut {
"submitting transaction to sequencer",
);
SubmitState::WaitingForSend {
fut: submit_tx(this.sequencer_http_client.clone(), tx, self.metrics)
.boxed(),
fut: submit_tx(this.cometbft_client.clone(), tx, self.metrics).boxed(),
}
}

Expand Down Expand Up @@ -784,8 +781,7 @@ impl Future for SubmitFut {
"resubmitting transaction to sequencer with new nonce",
);
SubmitState::WaitingForSend {
fut: submit_tx(this.sequencer_http_client.clone(), tx, self.metrics)
.boxed(),
fut: submit_tx(this.cometbft_client.clone(), tx, self.metrics).boxed(),
}
}
Err(error) => {
Expand Down
Loading

0 comments on commit cfbf479

Please sign in to comment.