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

Pre-generated SRS loading #328

Merged
merged 11 commits into from
Nov 3, 2023
14 changes: 7 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/api/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ mod tests {
.await;
assert_eq!(
response.body(),
r#"{"hash":"0x02419eab253b08659745c684e0bb26c15f327336d46c2c1e76e6cb67f734f79f","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","number":1,"state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","extrinsics_root":"0x0000000000000000000000000000000000000000000000000000000000000000","extension":{"rows":0,"cols":0,"data_root":null,"commitments":[],"app_lookup":{"size":0,"index":[]}}}"#
r#"{"hash":"0xffb84ad27c9d095b0f4790bd168637a6891f962d5a738e2dc7fbdb7a482cce83","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","number":1,"state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","extrinsics_root":"0x0000000000000000000000000000000000000000000000000000000000000000","extension":{"rows":0,"cols":0,"data_root":"0x0000000000000000000000000000000000000000000000000000000000000000","commitments":[],"app_lookup":{"size":0,"index":[]}}}"#
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/bin/avail-light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async fn run(error_sender: Sender<anyhow::Error>) -> Result<()> {
#[cfg(feature = "network-analysis")]
tokio::task::spawn(analyzer::start_traffic_analyzer(cfg.port, 10));

let pp = Arc::new(kate_recovery::testnet::public_params(1024));
let pp = Arc::new(kate_recovery::couscous::public_params());
let raw_pp = pp.to_raw_var_bytes();
let public_params_hash = hex::encode(sp_core::blake2_128(&raw_pp));
let public_params_len = hex::encode(raw_pp).len();
Expand Down
6 changes: 3 additions & 3 deletions src/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ mod tests {
config::substrate::Digest,
};
use hex_literal::hex;
use kate_recovery::testnet;
use kate_recovery::couscous;

#[test]
fn test_cell_count_for_confidence() {
Expand All @@ -532,7 +532,7 @@ mod tests {
async fn test_process_block_with_rpc() {
let mut mock_client = MockLightClient::new();
let cfg = LightClientConfig::from(&RuntimeConfig::default());
let pp = Arc::new(testnet::public_params(1024));
let pp = Arc::new(couscous::public_params());
let cells_fetched: Vec<Cell> = vec![];
let cells_unfetched = [
Position { row: 1, col: 3 },
Expand Down Expand Up @@ -677,7 +677,7 @@ mod tests {
let mut mock_client = MockLightClient::new();
let mut cfg = LightClientConfig::from(&RuntimeConfig::default());
cfg.disable_rpc = true;
let pp = Arc::new(testnet::public_params(1024));
let pp = Arc::new(couscous::public_params());
let cells_unfetched: Vec<Position> = vec![];
let header = Header {
parent_hash: hex!("c454470d840bc2583fcf881be4fd8a0f6daeac3a20d83b9fd4865737e56c9739")
Expand Down
8 changes: 4 additions & 4 deletions src/sync_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ mod tests {
config::substrate::Digest,
};
use hex_literal::hex;
use kate_recovery::testnet;
use kate_recovery::couscous;
use mockall::predicate::eq;

#[tokio::test]
pub async fn test_process_blocks_without_rpc() {
let (block_tx, _) = broadcast::channel::<types::BlockVerified>(10);
let pp = Arc::new(testnet::public_params(1024));
let pp = Arc::new(couscous::public_params());
let mut cfg = SyncClientConfig::from(&RuntimeConfig::default());
cfg.disable_rpc = true;
let mut mock_client = MockSyncClient::new();
Expand Down Expand Up @@ -450,7 +450,7 @@ mod tests {
#[tokio::test]
pub async fn test_process_blocks_with_rpc() {
let (block_tx, _) = broadcast::channel::<types::BlockVerified>(10);
let pp = Arc::new(testnet::public_params(1024));
let pp = Arc::new(couscous::public_params());
let cfg = SyncClientConfig::from(&RuntimeConfig::default());
let mut mock_client = MockSyncClient::new();
let header: DaHeader = DaHeader {
Expand Down Expand Up @@ -584,7 +584,7 @@ mod tests {
#[tokio::test]
pub async fn test_header_in_dbstore() {
let (block_tx, _) = broadcast::channel::<types::BlockVerified>(10);
let pp = Arc::new(testnet::public_params(1024));
let pp = Arc::new(couscous::public_params());
let cfg = SyncClientConfig::from(&RuntimeConfig::default());
let mut mock_client = MockSyncClient::new();
mock_client
Expand Down
Loading