-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update the chain id + bump to 0.9.1 + move constants * fix dockers * fix again
- Loading branch information
Showing
20 changed files
with
147 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,8 @@ lint: | |
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- trivy@0.55.2 | ||
- [email protected].6 | ||
- trivy@0.56.1 | ||
- [email protected].7 | ||
- [email protected] | ||
- [email protected] | ||
ignore: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule kakarot
updated
32 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use crate::{config::KakarotRpcConfig, eth_rpc::config::RPCConfig}; | ||
use num_traits::ToPrimitive; | ||
use starknet::{ | ||
core::types::{Felt, NonZeroFelt}, | ||
providers::{jsonrpc::HttpTransport, JsonRpcClient, Provider}, | ||
}; | ||
use std::sync::LazyLock; | ||
|
||
/// The max chain id allowed by [Metamask](https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553) | ||
pub static MAX_CHAIN_ID: u64 = (2u64.pow(53) - 39) / 2; | ||
/// The chain id of the underlying Starknet chain. | ||
pub static STARKNET_CHAIN_ID: LazyLock<Felt> = LazyLock::new(|| { | ||
tokio::task::block_in_place(|| { | ||
tokio::runtime::Handle::current().block_on(async { | ||
let provider = JsonRpcClient::new(HttpTransport::new(KAKAROT_RPC_CONFIG.network_url.clone())); | ||
provider.chain_id().await.expect("failed to get chain for chain") | ||
}) | ||
}) | ||
}); | ||
/// The chain id for the Ethereum chain running on the Starknet chain. | ||
pub static ETH_CHAIN_ID: LazyLock<u64> = LazyLock::new(|| { | ||
STARKNET_CHAIN_ID.div_rem(&NonZeroFelt::from_felt_unchecked(Felt::from(MAX_CHAIN_ID))).1.to_u64().expect("modulo") | ||
}); | ||
|
||
/// The Kakarot RPC configuration. | ||
pub static KAKAROT_RPC_CONFIG: LazyLock<KakarotRpcConfig> = | ||
LazyLock::new(|| KakarotRpcConfig::from_env().expect("failed to load Kakarot RPC config")); | ||
|
||
/// The RPC configuration. | ||
pub static RPC_CONFIG: LazyLock<RPCConfig> = | ||
LazyLock::new(|| RPCConfig::from_env().expect("failed to load RPC config")); |
Oops, something went wrong.