Propagate exceptions in outcome - #2467
Open
andreaslyn wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates transaction execution to propagate exceptions reliably across the fiber-based “previous transaction” dependency chain, by (a) using future.get() where rethrow is desired and (b) introducing an Outcome<T> container to carry either a normal Result<T> error or an exception.
Changes:
execute_transaction: switch fromfuture.wait()tofuture.get()so exceptions from the previous transaction are rethrown.execute_block: store per-transaction results asOutcome<Receipt>so exceptions are propagated via outcomes rather than via the final promiseget().core/result: addOutcome<T>and helpers to convert betweenResult<T>andOutcome<T>/ rethrow exceptions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| category/execution/monad/reserve_balance/reserve_balance_contract_test.cpp | Renames test-local Outcome enum to avoid clashing with the new monad::Outcome type alias. |
| category/execution/ethereum/execute_transaction.cpp | Uses future.get() to rethrow exceptions from the previous transaction when stalling / early-exiting on validation error. |
| category/execution/ethereum/execute_block.cpp | Tracks each transaction’s completion as an Outcome<Receipt> and defers exception propagation to the aggregation loop. |
| category/core/result.hpp | Introduces Outcome<T> plus conversion helpers; current implementation needs fixes for exception rethrow type and move semantics. |
Comments suppressed due to low confidence (1)
category/core/result.hpp:54
result_from_outcome_or_throwcurrently callsboost::rethrow_exception(out.exception()), butout.exception()isstd::exception_ptrwith the defaultOutcomealias. This should usestd::rethrow_exception. Also, return the value by moving out ofoutto avoid unintended copies / move-only failures.
template <typename T>
Result<T> result_from_outcome_or_throw(Outcome<T> out)
{
if (out.has_exception()) {
boost::rethrow_exception(out.exception());
}
if (out.has_error()) {
return std::move(out).assume_error();
}
return out.assume_value();
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andreaslyn
force-pushed
the
andreaslyn/outcome-exception
branch
from
July 28, 2026 13:08
4a4aa60 to
56ecb19
Compare
andreaslyn
force-pushed
the
andreaslyn/outcome-exception
branch
from
July 28, 2026 13:15
56ecb19 to
06da81b
Compare
dhil
reviewed
Jul 28, 2026
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.