Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (anvil): error E0063 when compile on macOS due to alloy-rs #7030

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

p3nj
Copy link
Contributor

@p3nj p3nj commented Feb 7, 2024

Motivation

An error occurs when Anvil is compiled from the crates/ directory as instructed. The error message states that the base_fee_per_blob_gas and blob_gas_used_ratio fields are missing in the alloy_rpc_types::FeeHistory initializer. This error is caused by recent changes made to the FeeHistory struct in alloy-rs fee.rs.
Here is the error message for reference:

Compiling anvil v0.2.0 (/Users/benji/Develop/blockchain/foundry/crates/anvil)
error[E0063]: missing fields base_fee_per_blob_gas and blob_gas_used_ratio in initializer of alloy_rpc_types::FeeHistory
--> crates/anvil/src/eth/[api.rs:1312](http://api.rs:1312/):28
|
1312 |         let mut response = FeeHistory {
|                            ^^^^^^^^^^ missing base_fee_per_blob_gas and blob_gas_used_ratio
For more information about this error, try rustc --explain E0063.
error: could not compile anvil (lib) due to previous error

Solution

Update the README.md file and modify the install command by including the --offline and --locked flags to ensure Cargo utilizes locally cached crates and avoids fetching newer versions from the internet.

Add `--offline --locked` prevent cargo from fetching the latest source, will cause FeeHistory to break due to a newer update of `alloy-rs`
@mattsse mattsse merged commit 8885e97 into foundry-rs:master Feb 7, 2024
2 checks passed
@p3nj p3nj deleted the patch-2 branch February 10, 2024 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants