Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into maintain_transaction_pool1
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Oct 28, 2024
2 parents 30a8306 + 8889ae9 commit 7aecd07
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ use kakarot_rpc::{
client::EthClient,
constants::{KAKAROT_RPC_CONFIG, RPC_CONFIG},
eth_rpc::{rpc::KakarotRpcModuleBuilder, run_server},
pool::{
constants::PRUNE_DURATION,
mempool::{maintain_transaction_pool, AccountManager},
pool::mempool::{maintain_transaction_pool, AccountManager},
providers::eth_provider::{
database::Database,
starknet::kakarot_core::{core::KakarotCoreReader, KAKAROT_ADDRESS},
},
providers::eth_provider::database::Database,
};
use mongodb::options::{DatabaseOptions, ReadConcern, WriteConcern};
use opentelemetry_sdk::runtime::Tokio;
use reth_transaction_pool::PoolConfig;
use starknet::{
core::types::Felt,
core::types::{BlockId, BlockTag, Felt},
providers::{jsonrpc::HttpTransport, JsonRpcClient},
};
use std::{env::var, str::FromStr, sync::Arc};
Expand Down Expand Up @@ -48,9 +48,12 @@ async fn main() -> Result<()> {
let starknet_provider = Arc::new(starknet_provider);

// Get the pool config
// TODO call Kakarot.get_base_fee
let config = PoolConfig { minimal_protocol_basefee: 0, ..Default::default() };
let contract_reader = KakarotCoreReader::new(*KAKAROT_ADDRESS, starknet_provider.clone());
let base_fee = contract_reader.get_base_fee().block_id(BlockId::Tag(BlockTag::Pending)).call().await?.base_fee;
let base_fee = base_fee.try_into()?;
let config = PoolConfig { minimal_protocol_basefee: base_fee, ..Default::default() };

// Init the Ethereum Client
let eth_client = EthClient::new(starknet_provider, config, db.clone());
let eth_client = Arc::new(eth_client);

Expand Down

0 comments on commit 7aecd07

Please sign in to comment.