Skip to content

Make transaction tracker oracle methods harder to misuse.#4471

Merged
afck merged 1 commit intolinera-io:mainfrom
afck:txn-tracker-oracle
Sep 3, 2025
Merged

Make transaction tracker oracle methods harder to misuse.#4471
afck merged 1 commit intolinera-io:mainfrom
afck:txn-tracker-oracle

Conversation

@afck
Copy link
Contributor

@afck afck commented Sep 3, 2025

Motivation

In the execution code, oracles must always be used as follows:

  • In replay mode, we consume an oracle response from the recorded ones.
  • If not in replay mode, we query the actual oracle to obtain the value.
  • In both cases, we have to add it to the oracle responses in the execution outcome.

It's currently easy to forget one of those steps.

Proposal

Refactor the transaction tracker's methods to make it a bit harder to use them the wrong way.

Test Plan

CI

Release Plan

  • Nothing to do / These changes follow the usual release cycle.
  • (But could easily be backported.)

Links

Copy link
Contributor

@deuszx deuszx left a comment

Choose a reason for hiding this comment

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

Yeah, this looks much better :)

@afck afck added this pull request to the merge queue Sep 3, 2025
Merged via the queue into linera-io:main with commit fa62e8c Sep 3, 2025
28 checks passed
@afck afck deleted the txn-tracker-oracle branch September 3, 2025 11:53
afck added a commit to afck/linera-protocol that referenced this pull request Sep 4, 2025
…4471)

## Motivation

In the execution code, oracles must always be used as follows:
* In replay mode, we consume an oracle response from the recorded ones.
* If _not_ in replay mode, we query the actual oracle to obtain the
value.
* In both cases, we have to add it to the oracle responses in the
execution outcome.

It's currently easy to forget one of those steps.

## Proposal

Refactor the transaction tracker's methods to make it a bit harder to
use them the wrong way.

## Test Plan

CI

## Release Plan

- Nothing to do / These changes follow the usual release cycle.
- (But could easily be backported.)

## Links

- Closes linera-io#3519.
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
@afck afck mentioned this pull request Sep 4, 2025
ma2bd pushed a commit that referenced this pull request Sep 5, 2025
## Motivation

In the execution code, oracles must always be used as follows:
* In replay mode, we consume an oracle response from the recorded ones.
* If _not_ in replay mode, we query the actual oracle to obtain the
value.
* In both cases, we have to add it to the oracle responses in the
execution outcome.

It's currently easy to forget one of those steps.

## Proposal

Refactor the transaction tracker's methods to make it a bit harder to
use them the wrong way.

## Test Plan

CI

## Release Plan

- Nothing to do / These changes follow the usual release cycle.
- (But could easily be backported.)

## Links

- Closes #3519.
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
ma2bd pushed a commit that referenced this pull request Sep 5, 2025
## Motivation

In the execution code, oracles must always be used as follows:
* In replay mode, we consume an oracle response from the recorded ones.
* If _not_ in replay mode, we query the actual oracle to obtain the
value.
* In both cases, we have to add it to the oracle responses in the
execution outcome.

It's currently easy to forget one of those steps.

## Proposal

Refactor the transaction tracker's methods to make it a bit harder to
use them the wrong way.

## Test Plan

CI

## Release Plan

- Nothing to do / These changes follow the usual release cycle.
- (But could easily be backported.)

## Links

- Closes #3519.
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
ma2bd added a commit to ma2bd/linera-protocol that referenced this pull request Sep 6, 2025
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.

Make next_replayed_oracle_response safer to use.

2 participants