Skip to content

Commit

Permalink
feat(conductor): rate limit sequencer cometbft requests
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFluffy committed May 14, 2024
1 parent 48a05a9 commit 794f80b
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 47 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions crates/astria-conductor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ rand = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
tendermint = { workspace = true }
tendermint-rpc = { workspace = true, features = ["http-client"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal"] }
tokio-util = { workspace = true, features = ["rt"] }
Expand All @@ -58,6 +60,7 @@ pin-project-lite = "0.2"
tokio-stream = "0.1.14"
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
moka = { version = "0.12.5", features = ["future"] }
tower = { version = "0.4.13", features = ["limit"] }

### Celestia specific imports
#
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/src/celestia/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use astria_eyre::eyre::{
WrapErr as _,
};
use jsonrpsee::http_client::HttpClient as CelestiaClient;
use sequencer_client::HttpClient as SequencerClient;
use tendermint_rpc::HttpClient as SequencerClient;
use tokio_util::sync::CancellationToken;

use super::Reader;
Expand Down
4 changes: 2 additions & 2 deletions crates/astria-conductor/src/celestia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use self::{
latest_height_stream::stream_latest_heights,
reconstruct::reconstruct_blocks_from_verified_blobs,
verify::{
verify_headers,
verify_metadata,
BlobVerifier,
},
};
Expand Down Expand Up @@ -521,7 +521,7 @@ impl FetchConvertVerifyAndReconstruct {
"decoded Sequencer header and rollup info from raw Celestia blobs",
);

let verified_blobs = verify_headers(blob_verifier, decoded_blobs).await;
let verified_blobs = verify_metadata(blob_verifier, decoded_blobs).await;

info!(
number_of_verified_header_blobs = verified_blobs.len_header_blobs(),
Expand Down
Loading

0 comments on commit 794f80b

Please sign in to comment.