Skip to content

Commit

Permalink
removing shit
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Feb 4, 2025
1 parent 904c840 commit f7f75fc
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions yarn-project/txe/src/oracle/txe_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
CallContext,
type ContractInstance,
type ContractInstanceWithAddress,
DEPLOYER_CONTRACT_ADDRESS,
Gas,
GasFees,
GlobalVariables,
Expand Down Expand Up @@ -888,36 +887,16 @@ export class TXE implements TypedOracle {
const executionRequest = new PublicExecutionRequest(callContext, args);

const db = this.baseFork;
const worldStateDb = new TXEWorldStateDB(db, new TXEPublicContractDataSource(this), this);

const globalVariables = GlobalVariables.empty();
globalVariables.chainId = new Fr(await this.node.getChainId());
globalVariables.version = new Fr(await this.node.getVersion());
globalVariables.blockNumber = new Fr(this.blockNumber);
globalVariables.gasFees = new GasFees(1, 1);

const tempFork = await this.nativeWorldStateService.fork();
// Apply current public data writes
await tempFork.sequentialInsert(
MerkleTreeId.PUBLIC_DATA_TREE,
this.publicDataWrites.map(p => p.toBuffer()),
);

// If the contract instance exists in the TXE's world state, make sure its nullifier is present in the tree
// so its nullifier check passes.
if ((await worldStateDb.getContractInstance(callContext.contractAddress)) !== undefined) {
const contractAddressNullifier = await siloNullifier(
AztecAddress.fromNumber(DEPLOYER_CONTRACT_ADDRESS),
callContext.contractAddress.toField(),
);
if ((await worldStateDb.getNullifierIndex(contractAddressNullifier)) === undefined) {
await tempFork.batchInsert(MerkleTreeId.NULLIFIER_TREE, [contractAddressNullifier.toBuffer()], 0);
}
}

const simulator = new PublicTxSimulator(
tempFork,
new TXEWorldStateDB(tempFork, new TXEPublicContractDataSource(this), this),
db,
new TXEWorldStateDB(db, new TXEPublicContractDataSource(this), this),
globalVariables,
);

Expand Down Expand Up @@ -954,7 +933,6 @@ export class TXE implements TypedOracle {
),
);

await tempFork.close();
return Promise.resolve(result);
}

Expand Down

0 comments on commit f7f75fc

Please sign in to comment.