Incremental compilation ICE with from compiler-state-dependent overflow errors
Opened this issue · 7 comments
So… here’s a bunch of traits and a deeply nested types
trait Tr<T: ?Sized> {}
impl Tr<()> for u8 {}
impl<Self_, T: ?Sized> Tr<S0<T>> for Self_ where Self_: Tr<T> {}
struct S0<T: ?Sized>(T);
type S1<T> = S0<S0<T>>;
type S2<T> = S1<S1<T>>;
type S3<T> = S2<S2<T>>;
type S4<T> = S3<S3<T>>;
type S5<T> = S4<S4<T>>;
type S6<T> = S5<S5<T>>;
// type S7<T> = S6<S6<T>>;
// update, for reproduction in 2023-09:
type S7<T> = S1<S2<S3<S4<S5<S6<T>>>>>>;
// (but compiler output below is not updated to mention newer Rust versions)
trait New<D> {}
impl<D: Copy, T: Tr<S7<()>>> New<D> for T {}
trait New2<D> {}
impl<D> New2<D> for u8 where u8: New<D> {}and here’s a macro that helps us ask the compiler for trait implementations (thanks @digama0)
macro_rules! assert_impl {($ty:ty: $($trait:tt)*) => {
const _: () = { fn f<T: $($trait)*>() {} fn g() { f::<$ty>() } };
}}and if we ask the compiler
// asked directly this fails:
assert_impl!(u8: New2<()>);then we’ll get an overflow error
error[E0275]: overflow evaluating the requirement `u8: Tr<S0<S0<()>>>`
--> src/lib.rs:2:55
|
2 | const _: () = { fn f<T: $($trait)*>() {} fn g() { f::<$ty>() } };
| - required by a bound in this ^^^^^^^^
...
24 | assert_impl!(u8: New2<()>);
| ---------------------------
| | |
| | required by this bound in `f`
| in this macro invocation
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`small_pg`)
= note: required because of the requirements on the impl of `Tr<S0<S0<S0<()>>>>` for `u8`
= note: 125 redundant requirements hidden
= note: required because of the requirements on the impl of `Tr<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<()>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` for `u8`
note: required because of the requirements on the impl of `New<()>` for `u8`
--> src/lib.rs:19:30
|
19 | impl<D: Copy, T: Tr<S7<()>>> New<D> for T {}
| ^^^^^^ ^
note: required because of the requirements on the impl of `New2<()>` for `u8`
--> src/lib.rs:21:9
|
21 | impl<D> New2<D> for u8 where u8: New<D> {}
| ^^^^^^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
So far so good. But if we “first” ask about u8: Tr<S7<()>>, then the overflow error disappears:
// first ask
assert_impl!(u8: Tr<S7<()>>);
// then ask
assert_impl!(u8: New2<()>);Of course the other way around, this still fails. Or instead of “of course it fails the other way around” let’s rather say: This is pretty bad already since the compilation success depends on the order in which two consts are defined. [Yes, consts, look into the definition of that macro ;-)]
Anyways. If we add a commented out version of the failing query above
// asked directly would fail:
// assert_impl!(u8: New2<()>);
// first ask
assert_impl!(u8: Tr<S7<()>>);
// then ask
assert_impl!(u8: New2<()>);this compiles, and if you uncomment the commented out second line here without cargo cleaning your library, incremental compilation suddently becomes very excited unhappy.
Checking small_pg v0.1.0 (/home/frank/Dokumente/playground/rust/small_pg)
thread 'rustc' panicked at 'assertion failed: `(left == right)`
left: `Some(Fingerprint(16365582130792536210, 18134235757999171202))`,
right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(1e88f23d10582546-8813245cfc000b69): Err(OverflowError)', /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.53.0-nightly (42816d61e 2021-04-24) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `u8: New2<()>`
#1 [typeck] type-checking `_::g`
end of query stack
error: could not compile `small_pg`
Detailed reproduction guide (edit: updated, 2023-09)
- use
nightly-2023-09-08 - create a library crate containing this code
cargo check- uncomment line 24, i.e. change line 24 to
assert_impl!(u8: New2<()>); cargo checkagain
@rustbot label T-compiler A-incr-comp I-ICE
The root cause of the incremental ICE is the order dependence of the overflow error.
This is tricky. Adding assert_impl!(u8: Tr<S7<()>>); makes the crate compile because we cache the result of u8 as Tr<S7<()>>. This allows us to perform just a single level of recursion when evaluating u8: New2<()>, which avoids hitting the overflow limit.
This means that whether or not the query succeeds or fails depends on the state of global trait selection caches, which is exactly the kind of thing that we want to avoid in order for incremental compilation to work.
One solution would be to cache the reached recursion depth as part of the trait selection result. This would allow us to deterministically error when evaluating u8 as New2<()> (assuming that the #![recursion_limit] has not been increased).
However, I'm not certain that we actually want to do this. As I understand it, the main role of #![recursion_limit] is to enforce that we stop evaluating traits at some point (the trait system is Turing-complete, so we can't know if a given trait evaluation will ever complete). Forcing the user to bump the #![recursion_limit] here doesn't actually serve any useful purpose, other than simplifying the incr comp implementation.
If we only had to do a cargo clean when we manually had adjusted the recursion_limit that would be a lot better than the current situation. I imagine in time we could detect that that situation had occured, but for now getting incremental compilation working again is probably more important than solving that edge case.
That could even imply that #recursion_limit should be a compiler flag rather than an attribute, in order to leverage the existing machinery for invalidating caches when compiler flags change.
Triage: I can't reproduce this from the "Detailed reproduction guide". Can you still reproduce? If so, would be great if you could "scriptify" the step-by-step for easier reproduction.
Still reproduces; need to change it to
type S7<T> = S1<S2<S3<S4<S5<S6<T>>>>>>;though
Here’s a script:
use std::{error::Error, fmt::Write, process::Stdio};
fn def_smax(n: u64, out: &mut String) -> String {
let mut n_ = n;
let bits: Vec<u64> = std::iter::from_fn(|| {
(n_ != 0).then(|| {
let b = n_ % 2;
n_ = n_ / 2;
b
})
})
.collect();
writeln!(out, "struct S0<T: ?Sized>(T);").unwrap();
for i in 1..bits.len() {
let i_ = i - 1;
writeln!(out, "type S{i}<T> = S{i_}<S{i_}<T>>;").unwrap();
}
let mut l = bits.len();
if n.is_power_of_two() {
return format!("S{}", l - 1);
}
if l == 0 {
l = 1;
}
write!(out, "type S{l}<T> = ").unwrap();
for (i, _) in bits.iter().enumerate().filter(|(_, &b)| b == 1) {
write!(out, "S{i}<").unwrap();
}
write!(out, "T").unwrap();
for _ in bits.iter().filter(|&&b| b == 1) {
write!(out, ">").unwrap();
}
writeln!(out, ";").unwrap();
format!("S{l}")
}
fn file(n: u64, commented: bool) -> String {
let comment = if commented { "// " } else { "" };
let mut s = String::new();
s += "\
macro_rules! assert_impl {($ty:ty: $($trait:tt)*) => {
const _: () = { fn f<T: $($trait)*>() {} fn g() { f::<$ty>() } };
}}
trait Tr<T: ?Sized> {}
impl Tr<()> for u8 {}
impl<Self_, T: ?Sized> Tr<S0<T>> for Self_ where Self_: Tr<T> {}
\
";
let s_max = def_smax(n, &mut s);
writeln!(
s,
"\n\
trait New<D> {{}}
impl<D: Copy, T: Tr<{s_max}<()>>> New<D> for T {{}}
trait New2<D> {{}}
impl<D> New2<D> for u8 where u8: New<D> {{}}
// asked directly would fail:
{comment}assert_impl!(u8: New2<()>);
// first ask
assert_impl!(u8: Tr<{s_max}<()>>);
// then ask
assert_impl!(u8: New2<()>);
\
"
)
.unwrap();
s
}
type Result<T> = std::result::Result<T, Box<dyn Error>>;
fn test(n: u64) -> Result<bool> {
std::fs::write("repro.rs", file(n, false))?;
let s = std::process::Command::new("rustc")
.args(["repro.rs", "--crate-type=lib"])
.stderr(Stdio::null())
.status()?;
Ok(s.success())
}
fn bisect_true_to_false(mut f: impl FnMut(u64) -> Result<bool>) -> Result<u64> {
if !f(0)? {
panic!("nothing to bisect");
}
// invariant after setup: true for lower, false for upper
let mut lower = 0;
let mut upper = 1;
// setup:
while f(upper)? {
lower = upper;
upper = lower.checked_mul(2).unwrap();
}
// bisection:
while lower + 1 < upper {
let mid = lower + (upper - lower) / 2;
if f(mid)? {
lower = mid;
} else {
upper = mid;
}
}
Ok(upper)
}
fn main() -> Result<()> {
println!("using Rust version:");
let _ = std::process::Command::new("rustc")
.args(["--version"])
// .stderr(Stdio::null())
.status()?;
let n = bisect_true_to_false(test)?;
println!("found suitable nesting: {n}");
let _ = std::fs::remove_dir_all("repro_incremental_build");
std::fs::write("repro.rs", file(n, true))?;
let s = std::process::Command::new("rustc")
.args([
"repro.rs",
"--crate-type=lib",
"-Cincremental=repro_incremental_build",
])
.stderr(Stdio::null())
.status()?;
assert!(s.success());
std::fs::write("repro.rs", file(n, false))?;
let _s = std::process::Command::new("rustc")
.args([
"repro.rs",
"--crate-type=lib",
"-Cincremental=repro_incremental_build",
])
// .stderr(Stdio::null())
.status()?;
std::fs::write("repro.rs", file(n, true))?;
let _ = std::fs::remove_dir_all("repro_incremental_build");
let _ = std::fs::remove_file("librepro.rlib");
Ok(())
}example output: (click “Details”)
using Rust version:
rustc 1.74.0-nightly (62ebe3a2b 2023-09-08)
found suitable nesting: 126
error: internal compiler error: encountered incremental compilation error with evaluate_obligation(db1f1911d7654687-bf2c4ff399a067c1)
|
= help: This is a known issue with the compiler. Run `cargo clean` to allow your project to compile
= note: Please follow the instructions below to create a bug report with the provided information
= note: See <https://github.com/rust-lang/rust/issues/84970> for more information
thread 'rustc' panicked at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/compiler/rustc_query_system/src/query/plumbing.rs:713:9:
Found unstable fingerprints for evaluate_obligation(db1f1911d7654687-bf2c4ff399a067c1): Err(Canonical)
stack backtrace:
0: 0x7fc0beeaebec - std::backtrace_rs::backtrace::libunwind::trace::h75b30c0cd68bc7af
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7fc0beeaebec - std::backtrace_rs::backtrace::trace_unsynchronized::h87a4581e60db2a55
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7fc0beeaebec - std::sys_common::backtrace::_print_fmt::hb61bbd4cad6c8d05
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:67:5
3: 0x7fc0beeaebec - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h78c87721a2fe0851
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7fc0bef14dfc - core::fmt::rt::Argument::fmt::h3a1f78153a55cf27
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/fmt/rt.rs:138:9
5: 0x7fc0bef14dfc - core::fmt::write::h78df6aa1c7979fcd
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/fmt/mod.rs:1094:21
6: 0x7fc0beea162e - std::io::Write::write_fmt::h51abcfccd2bfcce9
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/io/mod.rs:1714:15
7: 0x7fc0beeae9d4 - std::sys_common::backtrace::_print::h900c04ec6229a3eb
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7fc0beeae9d4 - std::sys_common::backtrace::print::heb918b083479ba12
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7fc0beeb1aca - std::panicking::panic_hook_with_disk_dump::{{closure}}::h308105f13195c33c
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:280:22
10: 0x7fc0beeb17c5 - std::panicking::panic_hook_with_disk_dump::h2f5bad6440ca252c
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:314:9
11: 0x7fc0c2092199 - <rustc_driver_impl[cd05ad6839bfc56]::install_ice_hook::{closure#0} as core[ebf5aac6096768e8]::ops::function::FnOnce<(&core[ebf5aac6096768e8]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
12: 0x7fc0beeb2383 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h360d41daa947bd02
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/alloc/src/boxed.rs:2021:9
13: 0x7fc0beeb2383 - std::panicking::rust_panic_with_hook::h1421e8b8ff5dcc6b
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:757:13
14: 0x7fc0beeb2101 - std::panicking::begin_panic_handler::{{closure}}::h2d0c8c0d9d1e2f4f
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:631:13
15: 0x7fc0beeaf116 - std::sys_common::backtrace::__rust_end_short_backtrace::h52598a748b289411
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:170:18
16: 0x7fc0beeb1e42 - rust_begin_unwind
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:619:5
17: 0x7fc0bef111a5 - core::panicking::panic_fmt::ha5aa6d3113b87400
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/panicking.rs:72:14
18: 0x7fc0c2966c9b - rustc_query_system[7116d6717f62651]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt>
19: 0x7fc0c1225d64 - rustc_query_system[7116d6717f62651]::query::plumbing::incremental_verify_ich::<rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 2usize]>>
20: 0x7fc0c1224e9d - rustc_query_system[7116d6717f62651]::query::plumbing::try_execute_query::<rustc_query_impl[ac5d0e1f94e8beb1]::DynamicConfig<rustc_query_system[7116d6717f62651]::query::caches::DefaultCache<rustc_middle[c9b4ea486b2cc26f]::infer::canonical::Canonical<rustc_middle[c9b4ea486b2cc26f]::ty::ParamEnvAnd<rustc_middle[c9b4ea486b2cc26f]::ty::Predicate>>, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::QueryCtxt, true>
21: 0x7fc0c122382e - rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
22: 0x7fc0c040ab9c - <rustc_trait_selection[660333be6ac77fd2]::traits::fulfill::FulfillProcessor as rustc_data_structures[477293ffaed49510]::obligation_forest::ObligationProcessor>::process_obligation
23: 0x7fc0c04044bb - <rustc_data_structures[477293ffaed49510]::obligation_forest::ObligationForest<rustc_trait_selection[660333be6ac77fd2]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[660333be6ac77fd2]::traits::fulfill::FulfillProcessor>
24: 0x7fc0c03f726f - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_call
25: 0x7fc0c037e15b - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
26: 0x7fc0c03a8261 - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_block_with_expected
27: 0x7fc0c037e581 - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
28: 0x7fc0c0df1828 - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_return_expr
29: 0x7fc0c0defdb1 - rustc_hir_typeck[3ed4fab84c81656a]::check::check_fn
30: 0x7fc0c0dd593a - rustc_hir_typeck[3ed4fab84c81656a]::typeck
31: 0x7fc0c018653e - rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 8usize]>>
32: 0x7fc0c018650e - <rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::typeck::dynamic_query::{closure#2} as core[ebf5aac6096768e8]::ops::function::FnOnce<(rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt, rustc_span[4ff801154ea5bebb]::def_id::LocalDefId)>>::call_once
33: 0x7fc0c079f2ec - rustc_query_system[7116d6717f62651]::query::plumbing::try_execute_query::<rustc_query_impl[ac5d0e1f94e8beb1]::DynamicConfig<rustc_query_system[7116d6717f62651]::query::caches::VecCache<rustc_span[4ff801154ea5bebb]::def_id::LocalDefId, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::QueryCtxt, true>
34: 0x7fc0c13ebe31 - rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
35: 0x7fc0c1059ccf - rustc_data_structures[477293ffaed49510]::sync::par_for_each_in::<&[rustc_span[4ff801154ea5bebb]::def_id::LocalDefId], <rustc_middle[c9b4ea486b2cc26f]::hir::map::Map>::par_body_owners<rustc_hir_analysis[93b67f360e7563cd]::check_crate::{closure#7}>::{closure#0}>
36: 0x7fc0c1058f33 - rustc_hir_analysis[93b67f360e7563cd]::check_crate
37: 0x7fc0c104e592 - rustc_interface[582cc29f0285046b]::passes::analysis
38: 0x7fc0c14c8c6a - rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 1usize]>>
39: 0x7fc0c14c8c59 - <rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::analysis::dynamic_query::{closure#2} as core[ebf5aac6096768e8]::ops::function::FnOnce<(rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt, ())>>::call_once
40: 0x7fc0c18840fb - rustc_query_system[7116d6717f62651]::query::plumbing::try_execute_query::<rustc_query_impl[ac5d0e1f94e8beb1]::DynamicConfig<rustc_query_system[7116d6717f62651]::query::caches::SingleCache<rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::QueryCtxt, true>
41: 0x7fc0c1883c54 - rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
42: 0x7fc0c15d6d13 - <rustc_middle[c9b4ea486b2cc26f]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>
43: 0x7fc0c15d5ddd - <rustc_interface[582cc29f0285046b]::interface::Compiler>::enter::<rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}::{closure#2}, core[ebf5aac6096768e8]::result::Result<core[ebf5aac6096768e8]::option::Option<rustc_interface[582cc29f0285046b]::queries::Linker>, rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>
44: 0x7fc0c15cf098 - std[9157628b7ed2032d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[582cc29f0285046b]::util::run_in_thread_with_globals<rustc_interface[582cc29f0285046b]::interface::run_compiler<core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>, rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}>::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>
45: 0x7fc0c15ce7ee - <<std[9157628b7ed2032d]::thread::Builder>::spawn_unchecked_<rustc_interface[582cc29f0285046b]::util::run_in_thread_with_globals<rustc_interface[582cc29f0285046b]::interface::run_compiler<core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>, rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}>::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>::{closure#1} as core[ebf5aac6096768e8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
46: 0x7fc0beebcd35 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf5dbb60f40d2446c
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/alloc/src/boxed.rs:2007:9
47: 0x7fc0beebcd35 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha1493913fb6c0c71
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/alloc/src/boxed.rs:2007:9
48: 0x7fc0beebcd35 - std::sys::unix::thread::Thread::new::thread_start::hf9152cd588461d2f
at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys/unix/thread.rs:108:17
49: 0x7fc0bebf1b43 - start_thread
at ./nptl/pthread_create.c:442:8
50: 0x7fc0bec83a00 - clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
51: 0x0 - <unknown>
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please attach the file at `/…/rustc-ice-2023-09-10T22:03:23.391769898Z-827614.txt` to your bug report
note: compiler flags: --crate-type lib -C incremental=[REDACTED]
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `u8: New2<()>` | = note: this failure-note originates in the macro `assert_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
#1 [typeck] type-checking `_::g`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
Got similar error
Details
error: internal compiler error: encountered incremental compilation error with evaluate_obligation(6b84da128df4760c-5c00c1c1c132a2d4) | = help: This is a known issue with the compiler. Run `cargo clean -p op_reth` or `cargo clean` to allow your project to compile = note: Please follow the instructions below to create a bug report with the provided information = note: See for more information
thread 'rustc' panicked at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/compiler/rustc_query_system/src/query/plumbing.rs:731:9:
Found unstable fingerprints for evaluate_obligation(6b84da128df4760c-5c00c1c1c132a2d4): Ok(EvaluatedToAmbig)
stack backtrace:
0: 0x7a5813fd6e40 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h6d42cc84fc840290
1: 0x7a581482867c - core::fmt::write::h5af61a909e3ec64d
2: 0x7a5815b2ca51 - std::io::Write::write_fmt::h5a7b54aa6e4a315d
3: 0x7a5813fd6ca2 - std::sys::backtrace::BacktraceLock::print::h555579e7396c26ac
4: 0x7a5813fd9122 - std::panicking::default_hook::{{closure}}::h9128866118196224
5: 0x7a5813fd8faa - std::panicking::default_hook::h52e9e7314e0255f6
6: 0x7a5813133449 - std[d9e466a2d75004a2]::panicking::update_hook::<alloc[54bfe2542ace865d]::boxed::Box<rustc_driver_impl[680c351c5444d7cd]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7a5813fd9ca3 - std::panicking::rust_panic_with_hook::h541791bcc774ef34
8: 0x7a5813fd999a - std::panicking::begin_panic_handler::{{closure}}::h6479a2f0137c7d19
9: 0x7a5813fd7329 - std::sys::backtrace::__rust_end_short_backtrace::ha04e7c0fc61ded91
10: 0x7a5813fd965d - rust_begin_unwind
11: 0x7a5810c3d920 - core::panicking::panic_fmt::h5764ee7030b7a73d
12: 0x7a58136d4c93 - rustc_query_system[9464b8c501ef87f3]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[a78c8f6c75429410]::ty::context::TyCtxt>
13: 0x7a5814caa5aa - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_query_system[9464b8c501ef87f3]::query::caches::DefaultCache<rustc_type_ir[282c50670f22d67a]::canonical::CanonicalQueryInput<rustc_middle[a78c8f6c75429410]::ty::context::TyCtxt, rustc_middle[a78c8f6c75429410]::ty::ParamEnvAnd<rustc_middle[a78c8f6c75429410]::ty::predicate::Predicate>>, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
14: 0x7a5814c975a1 - rustc_query_impl[abff21d8349146d]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
15: 0x7a5814b694e0 - <rustc_infer[86fba76a03fa934a]::infer::InferCtxt as rustc_trait_selection[2bf3b2046bc969f2]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
16: 0x7a5814b68ef4 - rustc_trait_selection[2bf3b2046bc969f2]::traits::type_known_to_meet_bound_modulo_regions
17: 0x7a5814bbc710 - rustc_ty_utils[e2efdac856cc2818]::common_traits::is_item_raw
18: 0x7a5814bbc41e - rustc_query_impl[abff21d8349146d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[abff21d8349146d]::query_impl::is_unpin_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>
19: 0x7a5814bbc3e3 - <rustc_query_impl[abff21d8349146d]::query_impl::is_unpin_raw::dynamic_query::{closure#2} as core[46aa9df3d3dcdeb1]::ops::function::FnOnce<(rustc_middle[a78c8f6c75429410]::ty::context::TyCtxt, rustc_middle[a78c8f6c75429410]::ty::PseudoCanonicalInput<rustc_middle[a78c8f6c75429410]::ty::Ty>)>>::call_once
20: 0x7a5814c8e44b - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_query_system[9464b8c501ef87f3]::query::caches::DefaultCache<rustc_middle[a78c8f6c75429410]::ty::PseudoCanonicalInput<rustc_middle[a78c8f6c75429410]::ty::Ty>, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
21: 0x7a5814daaf16 - rustc_query_impl[abff21d8349146d]::query_impl::is_unpin_raw::get_query_incr::__rust_end_short_backtrace
22: 0x7a5814dab24d - rustc_middle[a78c8f6c75429410]::query::plumbing::query_get_at::<rustc_query_system[9464b8c501ef87f3]::query::caches::DefaultCache<rustc_middle[a78c8f6c75429410]::ty::PseudoCanonicalInput<rustc_middle[a78c8f6c75429410]::ty::Ty>, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>>
23: 0x7a5814da8291 - <core[46aa9df3d3dcdeb1]::iter::adapters::enumerate::Enumerate<_> as core[46aa9df3d3dcdeb1]::iter::traits::iterator::Iterator>::try_fold::enumerate::<rustc_middle[a78c8f6c75429410]::ty::Ty, (), core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>>>, core[46aa9df3d3dcdeb1]::iter::adapters::map::map_try_fold<(usize, rustc_middle[a78c8f6c75429410]::ty::Ty), core[46aa9df3d3dcdeb1]::result::Result<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>, &rustc_middle[a78c8f6c75429410]::ty::layout::FnAbiError>, (), core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>>>, rustc_ty_utils[e2efdac856cc2818]::abi::fn_abi_new_uncached::{closure#3}, <core[46aa9df3d3dcdeb1]::iter::adapters::GenericShunt<core[46aa9df3d3dcdeb1]::iter::adapters::map::Map<core[46aa9df3d3dcdeb1]::iter::adapters::enumerate::Enumerate<core[46aa9df3d3dcdeb1]::iter::adapters::chain::Chain<core[46aa9df3d3dcdeb1]::iter::adapters::chain::Chain<core[46aa9df3d3dcdeb1]::iter::adapters::copied::Copied<core[46aa9df3d3dcdeb1]::slice::iter::Iter<rustc_middle[a78c8f6c75429410]::ty::Ty>>, core[46aa9df3d3dcdeb1]::iter::adapters::copied::Copied<core[46aa9df3d3dcdeb1]::slice::iter::Iter<rustc_middle[a78c8f6c75429410]::ty::Ty>>>, core[46aa9df3d3dcdeb1]::option::IntoIter<rustc_middle[a78c8f6c75429410]::ty::Ty>>>, rustc_ty_utils[e2efdac856cc2818]::abi::fn_abi_new_uncached::{closure#3}>, core[46aa9df3d3dcdeb1]::result::Result<core[46aa9df3d3dcdeb1]::convert::Infallible, &rustc_middle[a78c8f6c75429410]::ty::layout::FnAbiError>> as core[46aa9df3d3dcdeb1]::iter::traits::iterator::Iterator>::try_fold<(), core[46aa9df3d3dcdeb1]::iter::traits::iterator::Iterator::try_for_each::call<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>, core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>>, core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>>::Break>::{closure#0}, core[46aa9df3d3dcdeb1]::ops::control_flow::ControlFlow<rustc_target[e243455ff86e7771]::callconv::ArgAbi<rustc_middle[a78c8f6c75429410]::ty::Ty>>>::{closure#0}>::{closure#0}>::{closure#0}
24: 0x7a581525ebbc - rustc_ty_utils[e2efdac856cc2818]::abi::fn_abi_new_uncached
25: 0x7a5815258ef8 - rustc_ty_utils[e2efdac856cc2818]::abi::fn_abi_of_instance
26: 0x7a5815257efc - rustc_query_impl[abff21d8349146d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[abff21d8349146d]::query_impl::fn_abi_of_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 16usize]>>
27: 0x7a5815254577 - <rustc_query_impl[abff21d8349146d]::query_impl::fn_abi_of_instance::dynamic_query::{closure#2} as core[46aa9df3d3dcdeb1]::ops::function::FnOnce<(rustc_middle[a78c8f6c75429410]::ty::context::TyCtxt, rustc_middle[a78c8f6c75429410]::ty::PseudoCanonicalInput<(rustc_middle[a78c8f6c75429410]::ty::instance::Instance, &rustc_middle[a78c8f6c75429410]::ty::list::RawList<(), rustc_middle[a78c8f6c75429410]::ty::Ty>)>)>>::call_once
28: 0x7a5815253784 - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_query_system[9464b8c501ef87f3]::query::caches::DefaultCache<rustc_middle[a78c8f6c75429410]::ty::PseudoCanonicalInput<(rustc_middle[a78c8f6c75429410]::ty::instance::Instance, &rustc_middle[a78c8f6c75429410]::ty::list::RawList<(), rustc_middle[a78c8f6c75429410]::ty::Ty>)>, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
29: 0x7a58152520df - rustc_query_impl[abff21d8349146d]::query_impl::fn_abi_of_instance::get_query_incr::__rust_end_short_backtrace
30: 0x7a58152b8371 - <rustc_codegen_llvm[b1e78a831fc19f8a]::context::CodegenCx as rustc_codegen_ssa[2fbf08e84bf45db2]::traits::declare::PreDefineCodegenMethods>::predefine_fn
31: 0x7a58152b19f9 - rustc_codegen_llvm[b1e78a831fc19f8a]::base::compile_codegen_unit::module_codegen
32: 0x7a58157dde6e - <rustc_codegen_llvm[b1e78a831fc19f8a]::LlvmCodegenBackend as rustc_codegen_ssa[2fbf08e84bf45db2]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
33: 0x7a58157d9d57 - rustc_codegen_ssa[2fbf08e84bf45db2]::base::codegen_crate::<rustc_codegen_llvm[b1e78a831fc19f8a]::LlvmCodegenBackend>
34: 0x7a58157d90ef - <rustc_codegen_llvm[b1e78a831fc19f8a]::LlvmCodegenBackend as rustc_codegen_ssa[2fbf08e84bf45db2]::traits::backend::CodegenBackend>::codegen_crate
35: 0x7a58157e21f4 - <rustc_interface[84ab11ffe8dacd23]::queries::Linker>::codegen_and_build_linker
36: 0x7a581579aedd - rustc_interface[84ab11ffe8dacd23]::passes::create_and_enter_global_ctxt::<core[46aa9df3d3dcdeb1]::option::Option<rustc_interface[84ab11ffe8dacd23]::queries::Linker>, rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
37: 0x7a58157ab726 - rustc_interface[84ab11ffe8dacd23]::interface::run_compiler::<(), rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}>::{closure#1}
38: 0x7a58156e0744 - std[d9e466a2d75004a2]::sys::backtrace::_rust_begin_short_backtrace::<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_with_globals<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_pool_with_globals<rustc_interface[84ab11ffe8dacd23]::interface::run_compiler<(), rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
39: 0x7a58156e0419 - <<std[d9e466a2d75004a2]::thread::Builder>::spawn_unchecked<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_with_globals<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_pool_with_globals<rustc_interface[84ab11ffe8dacd23]::interface::run_compiler<(), rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[46aa9df3d3dcdeb1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
40: 0x7a58156dfbaf - std::sys::pal::unix::thread::Thread::new::thread_start::hcc5ed016d554f327
41: 0x7a580f69caa4 - start_thread
at ./nptl/pthread_create.c:447:8
42: 0x7a580f729c3c - clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
43: 0x0 -
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.86.0 (05f9846 2025-03-31) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=line-tables-only -C split-debuginfo=unpacked -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation reth_basic_payload_builder::BasicPayloadJob<reth_tasks::TaskExecutor, reth_optimism_payload_builder::builder::OpPayloadBuilder<reth_transaction_pool::Pool<reth_transaction_pool::validate::task::TransactionValidationTaskExecutor<reth_optimism_txpool::validator::OpTransactionValidator<reth_provider::providers::blockchain_provider::BlockchainProvider<reth_node_types::NodeTypesWithDBAdapter<reth_optimism_node::node::OpNode, alloc::sync::Arc<reth_db::implementation::mdbx::DatabaseEnv>>>, reth_optimism_txpool::transaction::OpPooledTransaction>>, reth_transaction_pool::ordering::CoinbaseTipOrdering<reth_optimism_txpool::transaction::OpPooledTransaction>, reth_transaction_pool::blobstore::disk::DiskFileBlobStore>, reth_provider::providers::blockchain_provider::BlockchainProvider<reth_node_types::NodeTypesWithDBAdapter<reth_optimism_node::node::OpNode, alloc::sync::Arc<reth_db::implementation::mdbx::DatabaseEnv>>>, reth_optimism_evm::OpEvmConfig>>: core::marker::Unpin
#1 [is_unpin_raw] computing whether reth_basic_payload_builder::BasicPayloadJob<reth_tasks::TaskExecutor, reth_optimism_payload_builder::builder::OpPayloadBuilder<reth_transaction_pool::Pool<reth_transaction_pool::validate::task::TransactionValidationTaskExecutor<reth_optimism_txpool::validator::OpTransactionValidator<reth_provider::providers::blockchain_provider::BlockchainProvider<reth_node_types::NodeTypesWithDBAdapter<reth_optimism_node::node::OpNode, alloc::sync::Arc<reth_db::implementation::mdbx::DatabaseEnv>>>, reth_optimism_txpool::transaction::OpPooledTransaction>>, reth_transaction_pool::ordering::CoinbaseTipOrdering<reth_optimism_txpool::transaction::OpPooledTransaction>, reth_transaction_pool::blobstore::disk::DiskFileBlobStore>, reth_provider::providers::blockchain_provider::BlockchainProvider<reth_node_types::NodeTypesWithDBAdapter<reth_optimism_node::node::OpNode, alloc::sync::Arc<reth_db::implementation::mdbx::DatabaseEnv>>>, reth_optimism_evm::OpEvmConfig>> is Unpin
... and 1 other queries... use env RUST_BACKTRACE=1 to see the full query stack
error: could not compile op-reth (bin "op-reth") due to 1 previous error
How to reproduce:
Download this repo: https://github.com/paradigmxyz/reth
Checkout to commit: eaaa22cf39c6b0e74a704e6a5fd25836e30abe37
Run command that will succeed:
cargo build --features jemalloc,asm-keccak --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml
Apply diff (or make some changes, like one print in mod.rs):
Subject: [PATCH] try different trie
---
Index: crates/engine/tree/src/tree/mod.rs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/crates/engine/tree/src/tree/mod.rs b/crates/engine/tree/src/tree/mod.rs
--- a/crates/engine/tree/src/tree/mod.rs (revision eaaa22cf39c6b0e74a704e6a5fd25836e30abe37)
+++ b/crates/engine/tree/src/tree/mod.rs (date 1746702450382)
@@ -186,8 +186,12 @@
self.blocks_by_hash.insert(hash, executed.clone());
+ println!("self.blocks_by_hash {}", self.blocks_by_hash.len());
+
self.blocks_by_number.entry(block_number).or_default().push(executed);
+ println!("self.blocks_by_number: block nums {} blocks inside {}", self.blocks_by_number.len(), self.blocks_by_number.values().map(|x| x.len()).sum::<usize>());
+
self.parent_to_child.entry(parent_hash).or_default().insert(hash);
for children in self.parent_to_child.values_mut() {
@@ -314,8 +318,9 @@
}
// remove trie updates that are below the finalized block
+ println!("before prune {} {}", finalized_num, self.persisted_trie_updates.len());
self.persisted_trie_updates.retain(|_, (block_num, _)| *block_num > finalized_num);
-
+ println!("after prune {}", self.persisted_trie_updates.len());
// The only block that should remain at the `finalized` number now, is the finalized
// block, if it exists.
//
@@ -364,6 +369,8 @@
// If the finalized num is ahead of the upper bound, and exists, we need to instead ensure
// that the only blocks removed, are canonical blocks less than the upper bound
+ println!("Pruning {:?} {:?}", upper_bound, finalized_num_hash.as_ref().unwrap().number);
+
let finalized_num_hash = finalized_num_hash.map(|mut finalized| {
if upper_bound.number < finalized.number {
finalized = upper_bound;
@@ -372,6 +379,7 @@
finalized
});
+
// We want to do two things:
// * remove canonical blocks that are persisted
// * remove forks whose root are below the finalized block
@@ -1388,6 +1396,9 @@
debug!(target: "engine::tree", pending=?block_num_hash, "updating pending block");
self.canonical_in_memory_state.set_pending_block(block.clone());
}
+ println!("self.state.tree_state.persisted_trie_updates: {}",
+ self.state.tree_state.persisted_trie_updates.len()
+ );
self.state.tree_state.insert_executed(block.clone());
self.metrics.engine.inserted_already_executed_blocks.increment(1);
@@ -1408,6 +1419,7 @@
if let Ok(res) = &mut output {
// track last received forkchoice state
+ println!("Setting state: {:?}", state);
self.state
.forkchoice_state_tracker
.set_latest(state, res.outcome.forkchoice_status());
@@ -2986,6 +2998,7 @@
) -> ProviderResult<()> {
// first fetch the finalized block number and then call the remove_before method on
// tree_state
+ println!("{:?}", finalized_hash);
let num = if let Some(hash) = finalized_hash {
self.provider.block_number(hash)?.map(|number| BlockNumHash { number, hash })
} else {
Run the same command (it should fail):
cargo build --features jemalloc,asm-keccak --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml