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

Remove the OracleRecord and OracleResponses types; never throw away responses. #2232

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

afck
Copy link
Contributor

@afck afck commented Jul 11, 2024

Motivation

The OracleResponses and OracleRecord types were just wrappers for iterators or vectors of responses, and are not really needed. The former was also a source of potential bugs: When replaying, we still want to return the replayed oracle responses together with the execution outcomes, so they end up in the ExecutedBlock. Also, when executing a system operation that created an application, we should still preserve the oracle responses returned by the initial system operation, rather than overwriting them with the ones from the contract initialization. (This potential bug didn't manifest itself yet, since so far no system operation both uses an oracle and creates an application.)

Proposal

Remove the two types, and fix the potential issues.

Test Plan

I changed the assertion in process_confirmed_block to compare not only the state hash and the outgoing messages, but also the oracle responses, i.e. the complete block execution outcome.

I tried locally that without this fix, but with the assertion, test_memory_run_application_with_dependency fails.

Links

@afck afck requested review from ma2bd, andresilva91 and jvff July 11, 2024 13:14
Copy link
Contributor

@ma2bd ma2bd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

linera-execution/src/runtime.rs Show resolved Hide resolved
@afck afck merged commit 5832ae6 into linera-io:main Jul 12, 2024
5 checks passed
@afck afck deleted the no-oracle-record branch July 12, 2024 08:18
MathieuDutSik pushed a commit to MathieuDutSik/linera-protocol_second that referenced this pull request Jul 12, 2024
…esponses. (linera-io#2232)

* Remove the OracleRecord type.

* Don't throw away returned oracle responses.

* Remove the OracleResponses type.

* Ensure matching block execution outcomes, including oracle responses.

* Fix tests; add an oracle entry also for rejected messages.
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.

None yet

2 participants