Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed May 20, 2024
1 parent 7007e8d commit d42f0bc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class PrivateKernelResetHints {
*/
public masterSecretKeys: Tuple<GrumpkinPrivateKey, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>,
/**
* Generators used to derive app secret keys from secret. In 1 to 1 correspondence with master secret keys.
* Generators used to derive app secret keys from secret. In 1 to 1 correspondence with `masterSecretKeys`
* (e.g. app secret key generator at index 2 corresponds to master secret key at the same index).
*/
public appSecretKeysGenerators: Tuple<Fr, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>,
) {}
Expand Down
13 changes: 5 additions & 8 deletions yarn-project/simulator/src/acvm/oracle/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@ export class Oracle {
return unpacked.map(toACVMField);
}

async getKeyValidationRequest([masterNullifierPublicKeyHash]: ACVMField[]): Promise<ACVMField[]> {
const { masterPublicKey: masterNullifierPublicKey, appSecretKey: appNullifierSecretKey } =
await this.typedOracle.getKeyValidationRequest(fromACVMField(masterNullifierPublicKeyHash));
async getKeyValidationRequest([masterPublicKeyHash]: ACVMField[]): Promise<ACVMField[]> {
const { masterPublicKey, appSecretKey } = await this.typedOracle.getKeyValidationRequest(
fromACVMField(masterPublicKeyHash),
);

return [
toACVMField(masterNullifierPublicKey.x),
toACVMField(masterNullifierPublicKey.y),
toACVMField(appNullifierSecretKey),
];
return [toACVMField(masterPublicKey.x), toACVMField(masterPublicKey.y), toACVMField(appSecretKey)];
}

async getContractInstance([address]: ACVMField[]) {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/simulator/src/acvm/oracle/typed_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export abstract class TypedOracle {
throw new OracleMethodNotAvailableError('unpackReturns');
}

getKeyValidationRequest(_npkMHash: Fr): Promise<KeyValidationRequest> {
getKeyValidationRequest(_pkMHash: Fr): Promise<KeyValidationRequest> {
throw new OracleMethodNotAvailableError('getKeyValidationRequest');
}

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/simulator/src/client/db_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ export interface DBOracle extends CommitmentsDB {
popCapsule(): Promise<Fr[]>;

/**
* Retrieve nullifier keys associated with a specific master nullifier public key and app address.
* @param npkMHash - The master nullifier public key hash.
* Retrieve keys associated with a specific master public key and app address.
* @param pkMHash - The master public key hash.
* @returns A Promise that resolves to nullifier keys.
* @throws If the nullifier keys are not registered in the key store.
* @throws If the keys are not registered in the key store.
*/
getKeyValidationRequest(npkMHash: Fr, contractAddress: AztecAddress): Promise<KeyValidationRequest>;
getKeyValidationRequest(pkMHash: Fr, contractAddress: AztecAddress): Promise<KeyValidationRequest>;

/**
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
Expand Down
10 changes: 5 additions & 5 deletions yarn-project/simulator/src/client/view_data_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export class ViewDataOracle extends TypedOracle {
}

/**
* Retrieve nullifier keys associated with a specific master nullifier public key and app address.
* @param npkMHash - The master nullifier public key hash.
* Retrieve keys associated with a specific master public key and app address.
* @param pkMHash - The master public key hash.
* @returns A Promise that resolves to nullifier keys.
* @throws If the nullifier keys are not registered in the key store.
* @throws If the keys are not registered in the key store.
*/
public override getKeyValidationRequest(npkMHash: Fr): Promise<KeyValidationRequest> {
return this.db.getKeyValidationRequest(npkMHash, this.contractAddress);
public override getKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest> {
return this.db.getKeyValidationRequest(pkMHash, this.contractAddress);
}

/**
Expand Down

0 comments on commit d42f0bc

Please sign in to comment.