Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci-tempo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ jobs:
cargo build --profile dev --locked -p forge -p cast -p anvil -p chisel
echo "${{ github.workspace }}/target/debug" >> "$GITHUB_PATH"

- name: Check Tempo fork schedule compatibility
env:
TEMPO_MAINNET_RPC_URL: ${{ secrets.TEMPO_MAINNET_RPC_URL }}
TEMPO_TESTNET_RPC_URL: ${{ secrets.TEMPO_TESTNET_RPC_URL }}
TEMPO_DEVNET_RPC_URL: ${{ secrets.TEMPO_DEVNET_RPC_URL }}
run: |
cargo test --locked -p cast --test cli tempo_fork_schedule_parses_configured_rpcs -- --exact --nocapture

# TODO: re-enable once devnet is up and stable
# - name: Run Tempo check on devnet
# if: |
Expand Down
53 changes: 27 additions & 26 deletions Cargo.lock

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

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,17 @@ mpp = { git = "https://github.com/tempoxyz/mpp-rs", rev = "554d20112eb014bd223d5
"reqwest-rustls-tls",
"ws",
] }
tempo-chainspec = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69", default-features = false }
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69", default-features = false, features = [
tempo-chainspec = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a", default-features = false }
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a", default-features = false, features = [
"serde",
] }
tempo-alloy = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69", default-features = false }
tempo-evm = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69", default-features = false }
tempo-revm = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69", default-features = false, features = [
tempo-alloy = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a", default-features = false }
tempo-evm = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a", default-features = false }
tempo-revm = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a", default-features = false, features = [
"serde",
] }
tempo-contracts = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69" }
tempo-precompiles = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69" }
tempo-contracts = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a" }
tempo-precompiles = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a" }

## Pinned dependencies. Enabled for the workspace in crates/test-utils.

Expand Down Expand Up @@ -607,9 +607,9 @@ alloy-op-hardforks = { git = "https://github.com/ethereum-optimism/optimism", re
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-core", rev = "2f90eb86d4549fa15a8cc2d99bfc1039bc083977" }

## tempo — unify crates.io versions (pulled by mpp) with git rev
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69" }
tempo-alloy = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69" }
tempo-contracts = { git = "https://github.com/tempoxyz/tempo", rev = "1e5a82dff207e2cbd6cecdcfb8ff3cd2e39baa69" }
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a" }
tempo-alloy = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a" }
tempo-contracts = { git = "https://github.com/tempoxyz/tempo", rev = "8bd4d01d37e3cc324030baacbce2da0862d7735a" }

# solar
solar = { package = "solar-compiler", git = "https://github.com/paradigmxyz/solar", rev = "530f129" }
Expand Down
4 changes: 3 additions & 1 deletion crates/cast/tests/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use alloy_rpc_types::{Authorization, BlockNumberOrTag, Index, TransactionRequest
use alloy_signer::Signer;
use alloy_signer_local::PrivateKeySigner;
use anvil::NodeConfig;
use eyre::{WrapErr, ensure, eyre};
use foundry_test_utils::{
rpc::{
next_etherscan_api_key, next_http_archive_rpc_url, next_http_rpc_endpoint,
Expand All @@ -18,8 +19,9 @@ use foundry_test_utils::{
str,
util::OutputExt,
};
use serde::Deserialize;
use serde_json::json;
use std::{fs, path::Path, str::FromStr};
use std::{env, fs, path::Path, str::FromStr};

#[macro_use]
extern crate foundry_test_utils;
Expand Down
1 change: 1 addition & 0 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ chrono.workspace = true
vergen = { workspace = true, features = ["build", "emit_and_set"] }

[dev-dependencies]
foundry-evm-hardforks.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
axum = { workspace = true }
tempfile.workspace = true
3 changes: 3 additions & 0 deletions crates/common/src/tempo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
mod keystore;
pub use keystore::*;

#[cfg(test)]
mod tests;

/// Conservative gas buffer for browser wallet transactions on Tempo chains.
///
/// Browser wallets may sign with P256 or WebAuthn instead of secp256k1, which costs more gas
Expand Down
55 changes: 55 additions & 0 deletions crates/common/src/tempo/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
use alloy_provider::{Provider, ProviderBuilder};
use eyre::WrapErr;
use foundry_evm_hardforks::TempoHardfork;
use serde::Deserialize;
use std::env;

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct TempoForkSchedule {
schedule: Vec<ForkInfo>,
#[allow(dead_code)]
active: String,
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct ForkInfo {
name: String,
}

async fn check_fork_schedule(rpc_url: &str) -> eyre::Result<()> {
let provider = ProviderBuilder::new().connect_http(rpc_url.parse()?);
let schedule: TempoForkSchedule = provider.raw_request("tempo_forkSchedule".into(), ()).await?;
for fork in &schedule.schedule {
fork.name.parse::<TempoHardfork>()?;
}
Ok(())
}

#[tokio::test(flavor = "multi_thread")]
async fn test_fork_schedule_parses_configured_rpcs() -> eyre::Result<()> {
let mut checked_any = false;

for (network, env_key) in [
("mainnet", "TEMPO_MAINNET_RPC_URL"),
("testnet", "TEMPO_TESTNET_RPC_URL"),
("devnet", "TEMPO_DEVNET_RPC_URL"),
] {
let rpc_url = match env::var(env_key) {
Ok(url) if !url.is_empty() => url,
_ => continue,
};
checked_any = true;

check_fork_schedule(&rpc_url)
.await
.wrap_err_with(|| format!("[{network}] {env_key}={rpc_url}"))?;
}

if !checked_any {
eprintln!("Missing Tempo RPC env vars. Skipping Tempo fork schedule compatibility test.");
}

Ok(())
}
Loading