Compare commits

..

5 Commits

Author SHA1 Message Date
Omar Abdulla 949d7d3802 Fix the working directory canonicalization 2025-11-04 06:12:49 +03:00
Omar Abdulla 6a20dbf058 Update the resolc compiler tests 2025-11-04 05:25:13 +03:00
Omar Abdulla 9987952c63 Fix an issue with file errors in substrate export-chainspec 2025-11-04 05:17:32 +03:00
Omar Abdulla 2087453634 Merge remote-tracking branch 'origin/main' into fix/os-error-in-substrate-export-chainspec 2025-11-04 05:17:06 +03:00
Omar Abdulla 9b75a4f236 Update the commit hash of resolc compiler tests 2025-11-03 00:25:56 +03:00
9 changed files with 30 additions and 36 deletions
-4
View File
@@ -13,7 +13,3 @@ workdir
!/schema.json !/schema.json
!/dev-genesis.json !/dev-genesis.json
# Ignore all shell scripts except for the `run_tests.sh` script
*.sh
!run_tests.sh
+5 -10
View File
@@ -359,11 +359,7 @@ where
Ok(()) Ok(())
} }
#[instrument( #[instrument(level = "info", skip_all)]
level = "info",
skip_all,
fields(block_number = tracing::field::Empty)
)]
pub async fn execute_function_call( pub async fn execute_function_call(
&mut self, &mut self,
_: &StepPath, _: &StepPath,
@@ -377,7 +373,6 @@ where
.handle_function_call_execution(step, deployment_receipts) .handle_function_call_execution(step, deployment_receipts)
.await .await
.context("Failed to handle the function call execution")?; .context("Failed to handle the function call execution")?;
tracing::Span::current().record("block_number", execution_receipt.block_number);
let tracing_result = self let tracing_result = self
.handle_function_call_call_frame_tracing(execution_receipt.transaction_hash) .handle_function_call_call_frame_tracing(execution_receipt.transaction_hash)
.await .await
@@ -621,8 +616,8 @@ where
} }
// Handling the calldata assertion // Handling the calldata assertion
if let Some(ref expected_output) = assertion.return_data { if let Some(ref expected_calldata) = assertion.return_data {
let expected = expected_output; let expected = expected_calldata;
let actual = &tracing_result.output.as_ref().unwrap_or_default(); let actual = &tracing_result.output.as_ref().unwrap_or_default();
if !expected if !expected
.is_equivalent(actual, resolver.as_ref(), resolution_context) .is_equivalent(actual, resolver.as_ref(), resolution_context)
@@ -633,9 +628,9 @@ where
?receipt, ?receipt,
?expected, ?expected,
%actual, %actual,
"Output assertion failed" "Calldata assertion failed"
); );
anyhow::bail!("Output assertion failed - Expected {expected:?} but got {actual}",); anyhow::bail!("Calldata assertion failed - Expected {expected:?} but got {actual}",);
} }
} }
+14 -2
View File
@@ -234,9 +234,15 @@ impl Platform for ReviveDevNodePolkavmResolcPlatform {
.path .path
.as_path(); .as_path();
let wallet = AsRef::<WalletConfiguration>::as_ref(&context).wallet(); let wallet = AsRef::<WalletConfiguration>::as_ref(&context).wallet();
let working_directory = AsRef::<WorkingDirectoryConfiguration>::as_ref(&context).as_path();
let export_chainspec_command = SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND; let export_chainspec_command = SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND;
SubstrateNode::node_genesis(revive_dev_node_path, export_chainspec_command, &wallet) SubstrateNode::node_genesis(
revive_dev_node_path,
export_chainspec_command,
&wallet,
working_directory,
)
} }
} }
@@ -302,9 +308,15 @@ impl Platform for ReviveDevNodeRevmSolcPlatform {
.path .path
.as_path(); .as_path();
let wallet = AsRef::<WalletConfiguration>::as_ref(&context).wallet(); let wallet = AsRef::<WalletConfiguration>::as_ref(&context).wallet();
let working_directory = AsRef::<WorkingDirectoryConfiguration>::as_ref(&context).as_path();
let export_chainspec_command = SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND; let export_chainspec_command = SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND;
SubstrateNode::node_genesis(revive_dev_node_path, export_chainspec_command, &wallet) SubstrateNode::node_genesis(
revive_dev_node_path,
export_chainspec_command,
&wallet,
working_directory,
)
} }
} }
+2 -3
View File
@@ -706,7 +706,6 @@ impl Calldata {
.await .await
.context("Failed to resolve calldata item during equivalence check")?; .context("Failed to resolve calldata item during equivalence check")?;
let other = U256::from_be_slice(&other); let other = U256::from_be_slice(&other);
Ok(this == other) Ok(this == other)
}) })
.buffered(0xFF) .buffered(0xFF)
@@ -719,7 +718,7 @@ impl Calldata {
} }
impl CalldataItem { impl CalldataItem {
#[instrument(level = "info", skip_all, err(Debug))] #[instrument(level = "info", skip_all, err)]
async fn resolve( async fn resolve(
&self, &self,
resolver: &(impl ResolverApi + ?Sized), resolver: &(impl ResolverApi + ?Sized),
@@ -907,7 +906,7 @@ impl<T: AsRef<str>> CalldataToken<T> {
let block_hash = resolver let block_hash = resolver
.block_hash(desired_block_number.into()) .block_hash(desired_block_number.into())
.await .await
.context(format!("Failed to resolve the block hash of block number {desired_block_number}"))?; .context("Failed to resolve block hash for desired block number")?;
Ok(U256::from_be_bytes(block_hash.0)) Ok(U256::from_be_bytes(block_hash.0))
} else if item == Self::BLOCK_NUMBER_VARIABLE { } else if item == Self::BLOCK_NUMBER_VARIABLE {
@@ -160,6 +160,7 @@ impl SubstrateNode {
&self.node_binary, &self.node_binary,
&self.export_chainspec_command, &self.export_chainspec_command,
&self.wallet, &self.wallet,
self.base_directory.as_path(),
) )
.context("Failed to prepare the chainspec command")?; .context("Failed to prepare the chainspec command")?;
@@ -251,10 +252,6 @@ impl SubstrateNode {
.arg(format!("ws://127.0.0.1:{substrate_rpc_port}")) .arg(format!("ws://127.0.0.1:{substrate_rpc_port}"))
.arg("--rpc-max-connections") .arg("--rpc-max-connections")
.arg(u32::MAX.to_string()) .arg(u32::MAX.to_string())
.arg("--index-last-n-blocks")
.arg(1_000u32.to_string())
.arg("--cache-size")
.arg(1_000u32.to_string())
.env("RUST_LOG", Self::PROXY_LOG_ENV) .env("RUST_LOG", Self::PROXY_LOG_ENV)
.stdout(stdout_file) .stdout(stdout_file)
.stderr(stderr_file); .stderr(stderr_file);
@@ -323,6 +320,7 @@ impl SubstrateNode {
node_path: &Path, node_path: &Path,
export_chainspec_command: &str, export_chainspec_command: &str,
wallet: &EthereumWallet, wallet: &EthereumWallet,
base_directory: impl AsRef<Path>,
) -> anyhow::Result<serde_json::Value> { ) -> anyhow::Result<serde_json::Value> {
trace!("Exporting the chainspec"); trace!("Exporting the chainspec");
let output = Command::new(node_path) let output = Command::new(node_path)
@@ -330,6 +328,7 @@ impl SubstrateNode {
.arg("--chain") .arg("--chain")
.arg("dev") .arg("dev")
.env_remove("RUST_LOG") .env_remove("RUST_LOG")
.current_dir(base_directory)
.output() .output()
.context("Failed to export the chain-spec")?; .context("Failed to export the chain-spec")?;
+1 -1
View File
@@ -104,7 +104,7 @@ where
}; };
debug!(%tx_hash, "Submitted Transaction"); debug!(%tx_hash, "Submitted Transaction");
pending_transaction.set_timeout(Some(Duration::from_secs(120))); pending_transaction.set_timeout(Some(Duration::from_secs(240)));
let tx_hash = pending_transaction.watch().await.context(format!( let tx_hash = pending_transaction.watch().await.context(format!(
"Transaction inclusion watching timeout for {tx_hash}" "Transaction inclusion watching timeout for {tx_hash}"
))?; ))?;
+2 -9
View File
@@ -2,13 +2,12 @@
use std::{ use std::{
collections::HashMap, collections::HashMap,
str::FromStr,
sync::{LazyLock, Mutex}, sync::{LazyLock, Mutex},
}; };
use revive_dt_common::types::VersionOrRequirement; use revive_dt_common::types::VersionOrRequirement;
use semver::{Version, VersionReq}; use semver::Version;
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};
use crate::list::List; use crate::list::List;
@@ -66,9 +65,6 @@ impl SolcDownloader {
target: &'static str, target: &'static str,
list: &'static str, list: &'static str,
) -> anyhow::Result<Self> { ) -> anyhow::Result<Self> {
static MAXIMUM_COMPILER_VERSION_REQUIREMENT: LazyLock<VersionReq> =
LazyLock::new(|| VersionReq::from_str("<=0.8.30").unwrap());
let version_or_requirement = version.into(); let version_or_requirement = version.into();
match version_or_requirement { match version_or_requirement {
VersionOrRequirement::Version(version) => Ok(Self { VersionOrRequirement::Version(version) => Ok(Self {
@@ -83,10 +79,7 @@ impl SolcDownloader {
.builds .builds
.into_iter() .into_iter()
.map(|build| build.version) .map(|build| build.version)
.filter(|version| { .filter(|version| requirement.matches(version))
MAXIMUM_COMPILER_VERSION_REQUIREMENT.matches(version)
&& requirement.matches(version)
})
.max() .max()
else { else {
anyhow::bail!("Failed to find a version that satisfies {requirement:?}"); anyhow::bail!("Failed to find a version that satisfies {requirement:?}");