Compare commits

...

8 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 d02152b565 Update version of tests (#202)
* Update the commit hash of resolc compiler tests

* Update the version of tests
2025-11-02 23:48:23 +00:00
Omar 75159229df Update the commit hash of resolc compiler tests (#201) 2025-11-02 21:27:26 +00:00
Omar Abdulla 9b75a4f236 Update the commit hash of resolc compiler tests 2025-11-03 00:25:56 +03:00
Omar 2af1a62319 Supply the revert reason in the logs (#200) 2025-11-02 17:54:11 +00:00
8 changed files with 43 additions and 10 deletions
+5 -1
View File
@@ -16,6 +16,7 @@ use alloy::{
primitives::{B256, FixedBytes, U256},
signers::local::PrivateKeySigner,
};
use anyhow::Context as _;
use clap::{Parser, ValueEnum, ValueHint};
use revive_dt_common::types::{ParsedTestSpecifier, PlatformIdentifier};
use semver::Version;
@@ -1079,7 +1080,10 @@ impl FromStr for WorkingDirectoryConfiguration {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(Default::default()),
_ => Ok(Self::Path(PathBuf::from(s))),
_ => PathBuf::from(s)
.canonicalize()
.context("Failed to canonicalize the working directory path")
.map(Self::Path),
}
}
}
+4 -1
View File
@@ -598,7 +598,10 @@ where
let expected = !assertion.exception;
let actual = receipt.status();
if actual != expected {
let revert_reason = tracing_result.revert_reason.as_ref();
let revert_reason = tracing_result
.revert_reason
.as_ref()
.or(tracing_result.error.as_ref());
tracing::error!(
expected,
actual,
+14 -2
View File
@@ -234,9 +234,15 @@ impl Platform for ReviveDevNodePolkavmResolcPlatform {
.path
.as_path();
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;
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
.as_path();
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;
SubstrateNode::node_genesis(revive_dev_node_path, export_chainspec_command, &wallet)
SubstrateNode::node_genesis(
revive_dev_node_path,
export_chainspec_command,
&wallet,
working_directory,
)
}
}
+11 -3
View File
@@ -1,5 +1,6 @@
use std::{collections::HashMap, fmt::Display, str::FromStr};
use alloy::hex::ToHexExt;
use alloy::primitives::{FixedBytes, utils::parse_units};
use alloy::{
eips::BlockNumberOrTag,
@@ -686,8 +687,8 @@ impl Calldata {
Calldata::Compound(items) => {
stream::iter(items.iter().zip(other.chunks(32)))
.map(|(this, other)| async move {
// The matterlabs format supports wildcards and therefore we
// also need to support them.
// The MatterLabs format supports wildcards and therefore we also need to
// support them.
if this.as_ref() == "*" {
return Ok::<_, anyhow::Error>(true);
}
@@ -768,7 +769,14 @@ impl CalldataItem {
match stack.as_slice() {
// Empty stack means that we got an empty compound calldata which we resolve to zero.
[] => Ok(U256::ZERO),
[CalldataToken::Item(item)] => Ok(*item),
[CalldataToken::Item(item)] => {
tracing::debug!(
original_item = ?self,
resolved_item = item.to_be_bytes::<32>().encode_hex(),
"Resolution Done"
);
Ok(*item)
}
_ => Err(anyhow::anyhow!(
"Invalid calldata arithmetic operation - Invalid stack"
)),
@@ -160,6 +160,7 @@ impl SubstrateNode {
&self.node_binary,
&self.export_chainspec_command,
&self.wallet,
self.base_directory.as_path(),
)
.context("Failed to prepare the chainspec command")?;
@@ -319,6 +320,7 @@ impl SubstrateNode {
node_path: &Path,
export_chainspec_command: &str,
wallet: &EthereumWallet,
base_directory: impl AsRef<Path>,
) -> anyhow::Result<serde_json::Value> {
trace!("Exporting the chainspec");
let output = Command::new(node_path)
@@ -326,6 +328,7 @@ impl SubstrateNode {
.arg("--chain")
.arg("dev")
.env_remove("RUST_LOG")
.current_dir(base_directory)
.output()
.context("Failed to export the chain-spec")?;
@@ -62,7 +62,10 @@ where
) -> TransportResult<Self::Fillable> {
match self.inner.prepare(provider, tx).await {
Ok(fill) => Ok(Some(fill)),
Err(_) => Ok(None),
Err(err) => {
tracing::debug!(error = ?err, "Gas Provider Estimation Failed, using fallback");
Ok(None)
}
}
}