@aztec/txe 0.0.1-commit.b655e406 → 0.0.1-commit.fce3e4f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bin/index.d.ts +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/oracle/interfaces.d.ts +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.d.ts +1 -1
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +20 -11
- package/dest/rpc_translator.d.ts +9 -6
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +14 -7
- package/dest/state_machine/archiver.d.ts +7 -6
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.d.ts +4 -2
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +3 -0
- package/dest/state_machine/global_variable_builder.d.ts +3 -2
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/index.d.ts +1 -1
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.d.ts +6 -5
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +8 -7
- package/dest/state_machine/synchronizer.d.ts +1 -1
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/txe_session.d.ts +1 -1
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +5 -3
- package/dest/util/encoding.d.ts +15 -15
- package/dest/util/expected_failure_error.d.ts +1 -1
- package/dest/util/expected_failure_error.d.ts.map +1 -1
- package/dest/util/txe_account_data_provider.d.ts +1 -1
- package/dest/util/txe_account_data_provider.d.ts.map +1 -1
- package/dest/util/txe_contract_data_provider.d.ts +1 -1
- package/dest/util/txe_contract_data_provider.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.d.ts +1 -1
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/utils/block_creation.d.ts +1 -1
- package/dest/utils/block_creation.d.ts.map +1 -1
- package/dest/utils/block_creation.js +1 -1
- package/dest/utils/tx_effect_creation.d.ts +2 -2
- package/dest/utils/tx_effect_creation.d.ts.map +1 -1
- package/dest/utils/tx_effect_creation.js +5 -5
- package/package.json +18 -17
- package/src/oracle/txe_oracle_top_level_context.ts +19 -10
- package/src/rpc_translator.ts +10 -10
- package/src/state_machine/archiver.ts +6 -5
- package/src/state_machine/dummy_p2p_client.ts +6 -1
- package/src/state_machine/global_variable_builder.ts +2 -1
- package/src/state_machine/mock_epoch_cache.ts +12 -11
- package/src/txe_session.ts +6 -4
- package/src/utils/block_creation.ts +1 -0
- package/src/utils/tx_effect_creation.ts +5 -5
package/src/txe_session.ts
CHANGED
|
@@ -25,6 +25,7 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
25
25
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
26
26
|
import { Body, L2Block } from '@aztec/stdlib/block';
|
|
27
27
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
28
|
+
import { computeProtocolNullifier } from '@aztec/stdlib/hash';
|
|
28
29
|
import { PrivateContextInputs } from '@aztec/stdlib/kernel';
|
|
29
30
|
import { makeAppendOnlyTreeSnapshot, makeGlobalVariables } from '@aztec/stdlib/testing';
|
|
30
31
|
import { CallContext, GlobalVariables, TxContext } from '@aztec/stdlib/tx';
|
|
@@ -66,7 +67,7 @@ type SessionState =
|
|
|
66
67
|
| {
|
|
67
68
|
name: 'PRIVATE';
|
|
68
69
|
nextBlockGlobalVariables: GlobalVariables;
|
|
69
|
-
|
|
70
|
+
protocolNullifier: Fr;
|
|
70
71
|
noteCache: ExecutionNoteCache;
|
|
71
72
|
taggingIndexCache: ExecutionTaggingIndexCache;
|
|
72
73
|
}
|
|
@@ -295,7 +296,8 @@ export class TXESession implements TXESessionStateHandler {
|
|
|
295
296
|
});
|
|
296
297
|
|
|
297
298
|
const txRequestHash = getSingleTxBlockRequestHash(nextBlockGlobalVariables.blockNumber);
|
|
298
|
-
const
|
|
299
|
+
const protocolNullifier = await computeProtocolNullifier(txRequestHash);
|
|
300
|
+
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
299
301
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
300
302
|
|
|
301
303
|
this.oracleHandler = new PrivateExecutionOracle(
|
|
@@ -316,7 +318,7 @@ export class TXESession implements TXESessionStateHandler {
|
|
|
316
318
|
// difference resides in that the simulator has all information needed in order to run the simulation, while ours
|
|
317
319
|
// will be ongoing as the different oracles will be invoked from the Noir test, until eventually the private
|
|
318
320
|
// execution finishes.
|
|
319
|
-
this.state = { name: 'PRIVATE', nextBlockGlobalVariables,
|
|
321
|
+
this.state = { name: 'PRIVATE', nextBlockGlobalVariables, protocolNullifier, noteCache, taggingIndexCache };
|
|
320
322
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
321
323
|
|
|
322
324
|
return (this.oracleHandler as PrivateExecutionOracle).getPrivateContextInputs();
|
|
@@ -392,7 +394,7 @@ export class TXESession implements TXESessionStateHandler {
|
|
|
392
394
|
// logs (other effects like enqueued public calls don't need to be considered since those are not allowed).
|
|
393
395
|
const txEffect = await makeTxEffect(
|
|
394
396
|
this.state.noteCache,
|
|
395
|
-
this.state.
|
|
397
|
+
this.state.protocolNullifier,
|
|
396
398
|
this.state.nextBlockGlobalVariables.blockNumber,
|
|
397
399
|
);
|
|
398
400
|
|
|
@@ -5,13 +5,13 @@ import { TxEffect, TxHash } from '@aztec/stdlib/tx';
|
|
|
5
5
|
|
|
6
6
|
export async function makeTxEffect(
|
|
7
7
|
noteCache: ExecutionNoteCache,
|
|
8
|
-
|
|
8
|
+
protocolNullifier: Fr,
|
|
9
9
|
txBlockNumber: number,
|
|
10
10
|
): Promise<TxEffect> {
|
|
11
11
|
const txEffect = TxEffect.empty();
|
|
12
12
|
|
|
13
|
-
const {
|
|
14
|
-
const nonceGenerator =
|
|
13
|
+
const { usedProtocolNullifierForNonces } = noteCache.finish();
|
|
14
|
+
const nonceGenerator = usedProtocolNullifierForNonces ? protocolNullifier : noteCache.getAllNullifiers()[0];
|
|
15
15
|
|
|
16
16
|
txEffect.noteHashes = await Promise.all(
|
|
17
17
|
noteCache
|
|
@@ -27,8 +27,8 @@ export async function makeTxEffect(
|
|
|
27
27
|
// Nullifiers are already siloed
|
|
28
28
|
txEffect.nullifiers = noteCache.getAllNullifiers();
|
|
29
29
|
|
|
30
|
-
if (
|
|
31
|
-
txEffect.nullifiers.unshift(
|
|
30
|
+
if (usedProtocolNullifierForNonces) {
|
|
31
|
+
txEffect.nullifiers.unshift(protocolNullifier);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
txEffect.txHash = new TxHash(new Fr(txBlockNumber));
|