Skip to content

Commit 99aec0d

Browse files
committed
merge main
2 parents 4106ad5 + 51bb612 commit 99aec0d

2 files changed

Lines changed: 32 additions & 13 deletions

File tree

crates/transaction-pool/src/best.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,9 @@ mod tests {
444444
assert_eq!(*first.hash(), *r1.hash());
445445

446446
// Simulate payload builder marking R1 as invalid
447-
merged.mark_invalid(
448-
&first,
449-
InvalidPoolTransactionError::Consensus(InvalidTransactionError::TxTypeNotSupported),
450-
);
447+
let kind =
448+
InvalidPoolTransactionError::Consensus(InvalidTransactionError::TxTypeNotSupported);
449+
merged.mark_invalid(&first, kind);
451450

452451
// The AA2D descendant must be skipped, while protocol txs still yield.
453452
assert_eq!(merged.next().map(|tx| *tx.hash()), Some(*l1.hash()));
@@ -469,10 +468,9 @@ mod tests {
469468
assert_eq!(*first.hash(), *r1.hash());
470469
assert_eq!(*second.hash(), *l1.hash());
471470

472-
merged.mark_invalid(
473-
&first,
474-
InvalidPoolTransactionError::Consensus(InvalidTransactionError::TxTypeNotSupported),
475-
);
471+
let kind =
472+
InvalidPoolTransactionError::Consensus(InvalidTransactionError::TxTypeNotSupported);
473+
merged.mark_invalid(&first, kind);
476474

477475
assert_eq!(merged.next().map(|tx| *tx.hash()), Some(*l2.hash()));
478476
assert!(merged.next().is_none());
@@ -495,10 +493,9 @@ mod tests {
495493
let first = merged.next().unwrap();
496494
assert_eq!(*first.hash(), *left_tx.hash());
497495

498-
merged.mark_invalid(
499-
&first,
500-
InvalidPoolTransactionError::Consensus(InvalidTransactionError::TxTypeNotSupported),
501-
);
496+
let kind =
497+
InvalidPoolTransactionError::Consensus(InvalidTransactionError::TxTypeNotSupported);
498+
merged.mark_invalid(&first, kind);
502499

503500
assert_eq!(merged.next().map(|tx| *tx.hash()), Some(*right_tx.hash()));
504501
assert!(merged.next().is_none());

scripts/foundry-patch.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,29 @@ sed -n '/^\[patch\./,$p' "$FOUNDRY_CARGO"
8383
# `cargo update` can pull newer upstream deps from Foundry's workspace, which is non-deterministic.
8484
# A normal resolver pass is enough to rewrite the lockfile entries for the tempo path overrides.
8585
# Keep this aligned with the CI Forge build so Optimism-only dependencies do not re-enter resolution.
86-
(cd "$FOUNDRY_ROOT" && cargo metadata --format-version=1 --no-default-features >/dev/null)
86+
#
87+
# When tempo's reth bump introduces a stricter constraint on a transitive crate
88+
# already pinned in foundry's lockfile (e.g. reth bumps `alloy-eip7928` to ^0.3.6
89+
# while foundry's lock has 0.3.5), cargo cannot resolve it without an update.
90+
# On such failures, parse the conflicting package out of the error and run a
91+
# targeted `cargo update -p <pkg>` for it, then retry. Loop while there are
92+
# pending conflicts so several distinct crates can be resolved in one run
93+
# without falling back to a blanket `cargo update`. Bail out if the same crate
94+
# conflicts twice in a row (i.e. `cargo update` made no progress).
95+
pushd "$FOUNDRY_ROOT" >/dev/null
96+
prev_conflict_pkg=""
97+
while true; do
98+
err="$(cargo metadata --format-version=1 --no-default-features 2>&1 >/dev/null)" && break
99+
conflict_pkg="$(printf '%s\n' "$err" | sed -nE "s/^error: failed to select a version for \`([^']+)\`.*/\1/p" | head -n1)"
100+
if [[ -z "$conflict_pkg" || "$conflict_pkg" == "$prev_conflict_pkg" ]]; then
101+
printf '%s\n' "$err" >&2
102+
exit 1
103+
fi
104+
echo "cargo metadata failed on '$conflict_pkg' constraint; running 'cargo update -p $conflict_pkg' and retrying"
105+
cargo update -p "$conflict_pkg" >/dev/null
106+
prev_conflict_pkg="$conflict_pkg"
107+
done
108+
popd >/dev/null
87109

88110
if grep -q '^source = "git+https://github.com/tempoxyz/tempo?rev=' "$FOUNDRY_ROOT/Cargo.lock"; then
89111
echo "ERROR: Tempo git sources still present in Cargo.lock after patching:" >&2

0 commit comments

Comments
 (0)