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

feat: txe native world state #11226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sklppy88
Copy link
Contributor

@sklppy88 sklppy88 commented Jan 15, 2025

Please see this PR. Decided to start fresh as there was a bunch of conflicts after coming back from hols.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sklppy88 sklppy88 changed the title init feat: txe native world state Jan 15, 2025
@sklppy88 sklppy88 changed the title feat: txe native world state draft: txe native world state Jan 15, 2025
@sklppy88 sklppy88 force-pushed the ek/feat/txe-native-world-state-3 branch 2 times, most recently from 22175df to 60872a1 Compare January 23, 2025 15:00
@sklppy88 sklppy88 changed the title draft: txe native world state feat: txe native world state Jan 23, 2025
@sklppy88 sklppy88 marked this pull request as ready for review January 23, 2025 15:01
@sklppy88 sklppy88 force-pushed the ek/feat/txe-native-world-state-3 branch from 60872a1 to ca367f4 Compare January 23, 2025 15:11
@sklppy88 sklppy88 changed the title feat: txe native world state draft: txe native world state Jan 23, 2025
await (this.typedOracle as TXE).addNullifiers(addressFromSingle(contractAddress), fromArray(nullifiers));
return toForeignCallResult([]);
}
// async addNullifiers(contractAddress: ForeignCallSingle, _length: ForeignCallSingle, nullifiers: ForeignCallArray) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep !

);
await this.txe.addPublicDataWrites([new PublicDataWrite(computePublicDataTreeLeafSlot(contract, slot), newValue)]);

// await this.merkleDb.batchInsert(
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused?

Copy link
Contributor Author

@sklppy88 sklppy88 Jan 24, 2025

Choose a reason for hiding this comment

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

@sklppy88 sklppy88 force-pushed the ek/feat/txe-native-world-state-3 branch 4 times, most recently from 73bebfa to e91fd71 Compare January 24, 2025 11:05
@sklppy88 sklppy88 requested a review from Thunkar January 24, 2025 11:17
@sklppy88 sklppy88 force-pushed the ek/feat/txe-native-world-state-3 branch 2 times, most recently from 53eafb8 to cd760ae Compare January 24, 2025 11:47
@sklppy88 sklppy88 changed the title draft: txe native world state feat: txe native world state Jan 24, 2025
@@ -239,10 +261,14 @@ export class TXE implements TypedOracle {
sideEffectsCounter = this.sideEffectCounter,
isStaticCall = false,
) {
const db = await this.#getTreesAt(blockNumber);
const previousBlockState = await this.#getTreesAt(blockNumber - 1);
if (blockNumber >= this.blockNumber) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Mmm, this is weird. Shouldn't we issue an error or something if someone tries to ask for stuff in the future?

header.state = await db.getStateReference();
header.globalVariables.blockNumber = new Fr(blockNumber);
if (blockNumber === 1) {
throw new Error('This is dickered');
Copy link
Contributor

Choose a reason for hiding this comment

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

wait wat

@sklppy88 sklppy88 force-pushed the ek/feat/txe-native-world-state-3 branch from cd760ae to 57e5cf4 Compare January 25, 2025 03:00
@sklppy88 sklppy88 force-pushed the ek/feat/txe-native-world-state-3 branch from 57e5cf4 to d05b12d Compare January 25, 2025 03:04
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.

2 participants