Repository navigation
chore: Check versioning #11611
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
Merged
Merged
chore: Check versioning #11611
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f6ae3fc
Remove async calls by pregenerating vk tree instead of computing on t…
spalladino c651787
Introduce components versions and embed into enr
spalladino d09d2dd
Remove await
spalladino 29d054f
Fix test and downgrade log
spalladino 592c201
Prevent peer to be added to dht if enr version is invalid
spalladino e104e9f
Check versions in json rpc client
spalladino e0b4168
Damn axios
spalladino d115450
Wire versioning to start cmd
spalladino 7ee6350
Lint and test fixes
spalladino 5fac8b8
Remove unused transaction protocol topic name
spalladino 3ba42fa
Add xxhash
spalladino 212556d
Fix generate order
spalladino f517a79
Set pxe L1 chain id
spalladino d20fbc9
Lint
spalladino 6176f5e
Default to skipping bootstrap node version check
spalladino 6711b1d
Rollback changes to p2p network test
spalladino 782657d
Fix autogeneration in noir protocol circuits
spalladino 922f001
Fix bot L1 chain id
spalladino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,12 +1,25 @@ | ||
| import { type ComponentsVersions, getVersioningResponseHandler } from '@aztec/circuit-types'; | ||
| import { type PXE, PXESchema } from '@aztec/circuit-types/interfaces'; | ||
| import { createSafeJsonRpcClient, makeFetch } from '@aztec/foundation/json-rpc/client'; | ||
| import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; | ||
|
|
||
| /** | ||
| * Creates a JSON-RPC client to remotely talk to PXE. | ||
| * @param url - The URL of the PXE. | ||
| * @param fetch - The fetch implementation to use. | ||
| * @returns A JSON-RPC client of PXE. | ||
| */ | ||
| export function createPXEClient(url: string, fetch = makeFetch([1, 2, 3], false)): PXE { | ||
| return createSafeJsonRpcClient<PXE>(url, PXESchema, false, 'pxe', fetch); | ||
| export function createPXEClient( | ||
| url: string, | ||
| versions: Partial<ComponentsVersions> = {}, | ||
| fetch = makeFetch([1, 2, 3], false), | ||
| ): PXE { | ||
| return createSafeJsonRpcClient<PXE>(url, PXESchema, { | ||
| namespaceMethods: 'pxe', | ||
| fetch, | ||
| onResponse: getVersioningResponseHandler({ | ||
| l2ProtocolContractsTreeRoot: protocolContractTreeRoot.toString(), | ||
| ...versions, | ||
| }), | ||
| }); | ||
| } |
This file contains hidden or 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,5 +1,6 @@ | ||
| import { deployInitialTestAccounts } from '@aztec/accounts/testing'; | ||
| import { AztecNodeApiSchema, PXESchema } from '@aztec/circuit-types'; | ||
| import { AztecNodeApiSchema, PXESchema, getVersioningMiddleware } from '@aztec/circuit-types'; | ||
| import { type ChainConfig } from '@aztec/circuit-types/config'; | ||
| import { | ||
| type NamespacedApiHandlers, | ||
| createNamespacedSafeJsonRpcServer, | ||
|
|
@@ -15,6 +16,7 @@ import { dirname, resolve } from 'path'; | |
| import { createSandbox } from '../sandbox.js'; | ||
| import { github, splash } from '../splash.js'; | ||
| import { createAccountLogs, extractNamespacedOptions, installSignalHandlers } from './util.js'; | ||
| import { getVersions } from './versioning.js'; | ||
|
|
||
| const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json'); | ||
| const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version; | ||
|
|
@@ -23,6 +25,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg | |
| // list of 'stop' functions to call when process ends | ||
| const signalHandlers: Array<() => Promise<void>> = []; | ||
| const services: NamespacedApiHandlers = {}; | ||
| let config: ChainConfig | undefined = undefined; | ||
|
|
||
| if (options.sandbox) { | ||
| const sandboxOptions = extractNamespacedOptions(options, 'sandbox'); | ||
|
|
@@ -61,7 +64,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg | |
| } else { | ||
| if (options.node) { | ||
| const { startNode } = await import('./cmds/start_node.js'); | ||
| await startNode(options, signalHandlers, services, userLog); | ||
| ({ config } = await startNode(options, signalHandlers, services, userLog)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very nice |
||
| } else if (options.proofVerifier) { | ||
| const { startProofVerifier } = await import('./cmds/start_proof_verifier.js'); | ||
| await startProofVerifier(options, signalHandlers, userLog); | ||
|
|
@@ -70,16 +73,16 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg | |
| await startBot(options, signalHandlers, services, userLog); | ||
| } else if (options.proverNode) { | ||
| const { startProverNode } = await import('./cmds/start_prover_node.js'); | ||
| await startProverNode(options, signalHandlers, services, userLog); | ||
| ({ config } = await startProverNode(options, signalHandlers, services, userLog)); | ||
| } else if (options.pxe) { | ||
| const { startPXE } = await import('./cmds/start_pxe.js'); | ||
| await startPXE(options, signalHandlers, services, userLog); | ||
| ({ config } = await startPXE(options, signalHandlers, services, userLog)); | ||
| } else if (options.archiver) { | ||
| const { startArchiver } = await import('./cmds/start_archiver.js'); | ||
| await startArchiver(options, signalHandlers, services); | ||
| ({ config } = await startArchiver(options, signalHandlers, services)); | ||
| } else if (options.p2pBootstrap) { | ||
| const { startP2PBootstrap } = await import('./cmds/start_p2p_bootstrap.js'); | ||
| await startP2PBootstrap(options, signalHandlers, services, userLog); | ||
| ({ config } = await startP2PBootstrap(options, signalHandlers, services, userLog)); | ||
| } else if (options.proverAgent) { | ||
| const { startProverAgent } = await import('./cmds/start_prover_agent.js'); | ||
| await startProverAgent(options, signalHandlers, services, userLog); | ||
|
|
@@ -102,14 +105,14 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg | |
| } | ||
|
|
||
| installSignalHandlers(debugLogger.info, signalHandlers); | ||
|
|
||
| const versions = getVersions(config); | ||
| if (Object.entries(services).length > 0) { | ||
| const rpcServer = createNamespacedSafeJsonRpcServer(services, { | ||
| http200OnError: false, | ||
| log: debugLogger, | ||
| middlewares: [getOtelJsonRpcPropagationMiddleware()], | ||
| middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)], | ||
| }); | ||
| const { port } = await startHttpRpcServer(rpcServer, { port: options.port }); | ||
| debugLogger.info(`Aztec Server listening on port ${port}`); | ||
| debugLogger.info(`Aztec Server listening on port ${port}`, versions); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the interest of cleaning up config i can remove this from config in a follow up