-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: granular public simulation benchmarks (#6924)
Allow the PXE to send classes that get registered to its node to allow better debug logging Consolidate the kernel phases enum Add benchmarking stats for AVM simulation Add benchmarking stats for public DB accesses made by avm simulation
- Loading branch information
1 parent
294968b
commit b70bc98
Showing
36 changed files
with
346 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { AztecAddress } from '@aztec/circuits.js'; | ||
import { openTmpStore } from '@aztec/kv-store/utils'; | ||
import { BenchmarkingContractArtifact } from '@aztec/noir-contracts.js/Benchmarking'; | ||
|
||
import { beforeEach } from '@jest/globals'; | ||
|
||
import { KVArchiverDataStore } from './kv_archiver_store.js'; | ||
|
||
describe('Contract Artifact Store', () => { | ||
let archiverStore: KVArchiverDataStore; | ||
|
||
beforeEach(() => { | ||
archiverStore = new KVArchiverDataStore(openTmpStore()); | ||
}); | ||
|
||
it('Should add and return contract artifacts', async () => { | ||
const artifact = BenchmarkingContractArtifact; | ||
const address = AztecAddress.random(); | ||
await archiverStore.addContractArtifact(address, artifact); | ||
await expect(archiverStore.getContractArtifact(address)).resolves.toEqual(artifact); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { type AztecAddress } from '@aztec/circuits.js'; | ||
import { type ContractArtifact } from '@aztec/foundation/abi'; | ||
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store'; | ||
import { contractArtifactFromBuffer, contractArtifactToBuffer } from '@aztec/types/abi'; | ||
|
||
export class ContractArtifactsStore { | ||
#contractArtifacts: AztecMap<string, Buffer>; | ||
|
||
constructor(db: AztecKVStore) { | ||
this.#contractArtifacts = db.openMap('archiver_contract_artifacts'); | ||
} | ||
|
||
addContractArtifact(address: AztecAddress, contractArtifact: ContractArtifact): Promise<void> { | ||
return this.#contractArtifacts.set(address.toString(), contractArtifactToBuffer(contractArtifact)); | ||
} | ||
|
||
getContractArtifact(address: AztecAddress): ContractArtifact | undefined { | ||
const contractArtifact = this.#contractArtifacts.get(address.toString()); | ||
// TODO(@spalladino): AztecMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from. | ||
return contractArtifact && contractArtifactFromBuffer(Buffer.from(contractArtifact)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,9 @@ | |
}, | ||
{ | ||
"path": "../types" | ||
}, | ||
{ | ||
"path": "../noir-contracts.js" | ||
} | ||
], | ||
"include": ["src"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
export { CompleteAddress, GrumpkinPrivateKey, type PartialAddress, type PublicKey } from '@aztec/circuits.js'; | ||
export * from './auth_witness.js'; | ||
export * from './aztec_node/rpc/index.js'; | ||
export * from './body.js'; | ||
export * from './function_call.js'; | ||
export * from './notes/index.js'; | ||
export * from './messaging/index.js'; | ||
export * from './interfaces/index.js'; | ||
export * from './l2_block.js'; | ||
export * from './body.js'; | ||
export * from './l2_block_downloader/index.js'; | ||
export * from './l2_block_source.js'; | ||
export * from './public_data_witness.js'; | ||
export * from './tx_effect.js'; | ||
export * from './logs/index.js'; | ||
export * from './merkle_tree_id.js'; | ||
export * from './messaging/index.js'; | ||
export * from './mocks.js'; | ||
export * from './notes/index.js'; | ||
export * from './packed_values.js'; | ||
export * from './public_data_witness.js'; | ||
export * from './public_data_write.js'; | ||
export * from './simulation_error.js'; | ||
export * from './sibling_path/index.js'; | ||
export * from './simulation_error.js'; | ||
export * from './tx/index.js'; | ||
export * from './tx_effect.js'; | ||
export * from './tx_execution_request.js'; | ||
export * from './packed_values.js'; | ||
export * from './interfaces/index.js'; | ||
export * from './auth_witness.js'; | ||
export * from './aztec_node/rpc/index.js'; | ||
export { CompleteAddress, type PublicKey, type PartialAddress, GrumpkinPrivateKey } from '@aztec/circuits.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export * from './tx.js'; | ||
export * from './processed_tx.js'; | ||
export * from './public_simulation_output.js'; | ||
export * from './simulated_tx.js'; | ||
export * from './tx.js'; | ||
export * from './tx_hash.js'; | ||
export * from './tx_receipt.js'; | ||
export * from './processed_tx.js'; | ||
export * from './public_simulation_output.js'; | ||
export * from './validator/tx_validator.js'; | ||
export * from './validator/aggregate_tx_validator.js'; | ||
export * from './validator/tx_validator.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.