From 726d09691429142893d04a2093aaaef2e3b20a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 11:17:52 +0100 Subject: [PATCH 01/20] init --- package.json | 1 + src/scripts/generateNodeConfigType.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/scripts/generateNodeConfigType.ts diff --git a/package.json b/package.json index 4dbdb4a8..fa548d4d 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration", "dev": "yarn build --watch", "generate": "wagmi generate", + "generate:node-config": "node ./src/dist/scripts/generateNodeConfigType.js", "test:unit": "vitest unit.test", "test:integration": "vitest integration.test", "postinstall": "patch-package", diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts new file mode 100644 index 00000000..d860abce --- /dev/null +++ b/src/scripts/generateNodeConfigType.ts @@ -0,0 +1,27 @@ +import { execSync } from 'child_process'; +import { readFileSync } from 'fs'; + +const nitroTag = 'v2.1.2-4c55843-dev'; +const nitroHelpOutputFile = 'nitro-node-help-output.txt'; + +function main() { + execSync(`docker run --rm offchainlabs/nitro-node:${nitroTag} --help >& ${nitroHelpOutputFile}`); + + const content = readFileSync(nitroHelpOutputFile, 'utf8'); + let lines = content.split('\n'); + lines = lines.splice(1, lines.length - 2).map((line) => line.trim()); + lines = lines.splice(0, 5); + lines = lines.map((line) => line.replace(/\s\s+/g, ':')); + const blas = lines + .map((line) => line.split(':')) + .map(([param, comment]) => [...param.split(' '), comment]) + .map(([param, type, comment]) => ({ + param: param.replace('--', ''), + type, + comment, + })); + + console.log(blas); +} + +main(); From 20e4530483cd2add1a38ae97ebca7e9c48f28247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 16:18:38 +0100 Subject: [PATCH 02/20] generate node config type --- package.json | 3 +- src/scripts/generateNodeConfigType.ts | 168 ++++- src/types/NodeConfig-Generated.ts | 957 ++++++++++++++++++++++++++ yarn.lock | 49 +- 4 files changed, 1155 insertions(+), 22 deletions(-) create mode 100644 src/types/NodeConfig-Generated.ts diff --git a/package.json b/package.json index fa548d4d..b04c4405 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration", "dev": "yarn build --watch", "generate": "wagmi generate", - "generate:node-config": "node ./src/dist/scripts/generateNodeConfigType.js", + "generate:node-config-type": "node ./src/dist/scripts/generateNodeConfigType.js && prettier --write ./src/types/NodeConfig-Generated.ts", "test:unit": "vitest unit.test", "test:integration": "vitest integration.test", "postinstall": "patch-package", @@ -24,6 +24,7 @@ "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", "prettier": "^2.8.3", + "ts-morph": "^21.0.1", "typescript": "^5.2.2", "vitest": "^0.34.6" } diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index d860abce..681414cc 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -1,27 +1,155 @@ import { execSync } from 'child_process'; -import { readFileSync } from 'fs'; +import { readFileSync, rmSync } from 'fs'; +import { Project, Writers } from 'ts-morph'; -const nitroTag = 'v2.1.2-4c55843-dev'; -const nitroHelpOutputFile = 'nitro-node-help-output.txt'; +const { objectType } = Writers; + +const nitroNodeImage = 'offchainlabs/nitro-node:v2.1.2-4c55843-dev'; +const nitroNodeHelpOutputFile = 'nitro-node-help-output.txt'; + +function generateHeader() { + return [ + `// ---`, + `//`, + `// THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY`, + `//`, + `// IMAGE: ${nitroNodeImage}`, + `// TIMESTAMP: ${new Date().toISOString()}`, + `// `, + `// ---`, + ].join('\n'); +} + +type CliOption = { + name: string; + type: string; + docs: string[]; +}; + +function parseCliOptions(fileContents: string): CliOption[] { + const types: Record = { + string: 'string', + strings: 'string[]', + stringArray: 'string[]', + int: 'number', + uint: 'number', + uint32: 'number', + float: 'number', + duration: 'number', + boolean: 'boolean', + }; + + // split into lines + let lines = fileContents.split('\n'); + // trim whitespaces + lines = lines.map((line) => line.trim()); + // only leave lines that start with "--", i.e. the flag + lines = lines.filter((line) => line.startsWith('--')); + // sanitize the boolean types + lines = lines.map((line) => { + let split = line.split(' '); + // if the flag is just a boolean, then the type is omitted from the --help output, e.g. "--init.force" + // to make things simpler and consistent, we replace the empty string with boolean + if (split[1] === '') { + split[1] = 'boolean'; + } + + return split.join(' '); + }); + + return lines.map((line) => { + const [name, type] = line.split(' '); + + // get the mapped type from go to typescript + const sanitizedType = types[type]; + + // docs is everything after the param name and type (and one space in between) + const docsStart = name.length + 1 + type.length; + const docs = line.slice(docsStart).trim(); + + if (typeof sanitizedType === 'undefined') { + throw new Error(`Unknown type: ${type}`); + } + + return { + // remove "--" from the name + name: name.replace('--', ''), + // map the go type to the typescript type + type: sanitizedType, + // copy the rest of the line as docs + docs: [docs], + }; + }); +} + +type CliOptionNestedObject = any; + +function createCliOptionsNestedObject(options: CliOption[]): CliOptionNestedObject { + const result: CliOptionNestedObject = {}; + + options.forEach((option) => { + let path = option.name.split('.'); + let current = result; + + for (let i = 0; i < path.length; i++) { + if (!current[path[i]]) { + if (i === path.length - 1) { + current[path[i]] = option; + } else { + current[path[i]] = {}; + } + } + + current = current[path[i]]; + } + }); + + return result; +} + +//@ts-ignore +function getType(something: any) { + if (typeof something === 'object' && 'type' in something) { + return something.type; + } + + return objectType({ + //@ts-ignore + properties: Object.entries(something).map(([key, value]) => ({ + name: `'${key}'`, + type: getType(value), + //@ts-ignore + docs: value.docs, + })), + }); +} function main() { - execSync(`docker run --rm offchainlabs/nitro-node:${nitroTag} --help >& ${nitroHelpOutputFile}`); - - const content = readFileSync(nitroHelpOutputFile, 'utf8'); - let lines = content.split('\n'); - lines = lines.splice(1, lines.length - 2).map((line) => line.trim()); - lines = lines.splice(0, 5); - lines = lines.map((line) => line.replace(/\s\s+/g, ':')); - const blas = lines - .map((line) => line.split(':')) - .map(([param, comment]) => [...param.split(' '), comment]) - .map(([param, type, comment]) => ({ - param: param.replace('--', ''), - type, - comment, - })); - - console.log(blas); + // run --help on the nitro binary and save the output to a file + execSync(`docker run --rm ${nitroNodeImage} --help >& ${nitroNodeHelpOutputFile}`); + // read and parse the file + const content = readFileSync(nitroNodeHelpOutputFile, 'utf8'); + const cliOptions = parseCliOptions(content); + const obj = createCliOptionsNestedObject(cliOptions); + + const sourceFile = new Project().createSourceFile('./src/types/NodeConfig-Generated.ts', '', { + overwrite: true, + }); + + // append header + sourceFile.insertText(0, generateHeader()); + // append NodeConfig type declaration + sourceFile.addTypeAlias({ + name: 'NodeConfig', + // @ts-ignore + type: getType(obj), + docs: ['Nitro node configuration options'], + isExported: true, + }); + // save file to disk + sourceFile.saveSync(); + + rmSync(nitroNodeHelpOutputFile); } main(); diff --git a/src/types/NodeConfig-Generated.ts b/src/types/NodeConfig-Generated.ts new file mode 100644 index 00000000..04aa80c4 --- /dev/null +++ b/src/types/NodeConfig-Generated.ts @@ -0,0 +1,957 @@ +// --- +// +// THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY +// +// IMAGE: offchainlabs/nitro-node:v2.1.2-4c55843-dev +// TIMESTAMP: 2024-01-05T15:18:30.648Z +// +// --- +/** Nitro node configuration options */ +export type NodeConfig = { + 'auth': { + /** AUTH-RPC server listening interface (default "127.0.0.1") */ + addr: string; + /** APIs offered over the AUTH-RPC interface (default [validation]) */ + api: string[]; + /** Path to file holding JWT secret (32B hex) */ + jwtsecret: string; + /** Origins from which to accept AUTH requests (default [localhost]) */ + origins: string[]; + /** AUTH-RPC server listening port (default 8549) */ + port: number; + }; + 'chain': { + 'dev-wallet': { + /** account to use (default is first account in keystore) */ + 'account': string; + /** if true, creates new key then exits */ + 'only-create-key': boolean; + /** wallet passphrase (default "PASSWORD_NOT_SET") */ + 'password': string; + /** pathname for wallet */ + 'pathname': string; + /** private key for wallet */ + 'private-key': string; + }; + /** L2 chain ID (determines Arbitrum network) */ + 'id': number; + /** L2 chain info json files */ + 'info-files': string[]; + /** path to save temp downloaded file (default "/tmp/") */ + 'info-ipfs-download-path': string; + /** url to download chain info file */ + 'info-ipfs-url': string; + /** L2 chain info in json string format */ + 'info-json': string; + /** L2 chain name (determines Arbitrum network) */ + 'name': string; + }; + 'conf': { + /** print out currently active configuration file */ + 'dump': boolean; + /** environment variables with given prefix will be loaded as configuration values */ + 'env-prefix': string; + /** name of configuration file */ + 'file': string[]; + /** how often to reload configuration (0=disable periodic reloading) */ + 'reload-interval': number; + 's3': { + /** S3 access key */ + 'access-key': string; + /** S3 bucket */ + 'bucket': string; + /** S3 object key */ + 'object-key': string; + /** S3 region */ + 'region': string; + /** S3 secret key */ + 'secret-key': string; + }; + /** configuration as JSON string */ + 'string': string; + }; + 'file-logging': { + /** size of intermediate log records buffer (default 512) */ + 'buf-size': number; + /** enable compression of old log files (default true) */ + 'compress': boolean; + /** enable logging to file (default true) */ + 'enable': boolean; + /** path to log file (default "nitro.log") */ + 'file': string; + /** if true: local time will be used in old log filename timestamps */ + 'local-time': boolean; + /** maximum number of days to retain old log files based on the timestamp encoded in their filename (0 = no limit) */ + 'max-age': number; + /** maximum number of old log files to retain (0 = no limit) (default 20) */ + 'max-backups': number; + /** log file size in Mb that will trigger log file rotation (0 = trigger disabled) (default 5) */ + 'max-size': number; + }; + 'graphql': { + /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ + corsdomain: string[]; + /** Enable graphql endpoint on the rpc endpoint */ + enable: boolean; + /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ + vhosts: string[]; + }; + 'http': { + /** HTTP-RPC server listening interface */ + 'addr': string; + /** APIs offered over the HTTP-RPC interface (default [net,web3,eth,arb]) */ + 'api': string[]; + /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ + 'corsdomain': string[]; + /** HTTP-RPC server listening port (default 8547) */ + 'port': number; + /** HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ + 'rpcprefix': string; + 'server-timeouts': { + /** the maximum amount of time to wait for the next request when keep-alives are enabled (http.Server.IdleTimeout) (default 2m0s) */ + 'idle-timeout': number; + /** the amount of time allowed to read the request headers (http.Server.ReadHeaderTimeout) (default 30s) */ + 'read-header-timeout': number; + /** the maximum duration for reading the entire request (http.Server.ReadTimeout) (default 30s) */ + 'read-timeout': number; + /** the maximum duration before timing out writes of the response (http.Server.WriteTimeout) (default 30s) */ + 'write-timeout': number; + }; + /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ + 'vhosts': string[]; + }; + 'init': { + /** during init - sync database every X accounts. Lower value for low-memory systems. 0 disables. (default 100000) */ + 'accounts-per-sync': number; + /** init with dev data (1 account with balance) instead of file import */ + 'dev-init': boolean; + /** Address of dev-account. Leave empty to use the dev-wallet. */ + 'dev-init-address': string; + /** Number of preinit blocks. Must exist in ancient database. */ + 'dev-init-blocknum': number; + /** path to save temp downloaded file (default "/tmp/") */ + 'download-path': string; + /** how long to wait between polling attempts (default 1m0s) */ + 'download-poll': number; + /** init with empty state */ + 'empty': boolean; + /** if true: in case database exists init code will be reexecuted and genesis block compared to database */ + 'force': boolean; + /** path for json data to import */ + 'import-file': string; + /** pruning for a given use: "full" for full nodes serving RPC requests, or "validator" for validators */ + 'prune': string; + /** the amount of memory in megabytes to use for the pruning bloom filter (higher values prune better) (default 2048) */ + 'prune-bloom-size': number; + /** forces a reset to an old message height. Also set max-reorg-resequence-depth=0 to force re-reading messages (default -1) */ + 'reset-to-message': number; + /** quit after init is done */ + 'then-quit': boolean; + /** url to download initializtion data - will poll if download fails */ + 'url': string; + }; + 'ipc': { + /** Requested location to place the IPC endpoint. An empty path disables IPC. */ + path: string; + }; + /** log level (default 3) */ + 'log-level': number; + /** log type (plaintext or json) (default "plaintext") */ + 'log-type': string; + /** enable metrics */ + 'metrics': boolean; + 'metrics-server': { + /** metrics server address (default "127.0.0.1") */ + 'addr': string; + /** metrics server port (default 6070) */ + 'port': number; + /** metrics server update interval (default 3s) */ + 'update-interval': number; + }; + 'node': { + /** retain past block state (deprecated, please use node.caching.archive) */ + 'archive': boolean; + 'batch-poster': { + /** batch compression level (default 11) */ + 'compression-level': number; + /** In AnyTrust mode, the period which DASes are requested to retain the stored batches. (default 360h0m0s) */ + 'das-retention-period': number; + 'data-poster': { + /** if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance (default true) */ + 'allocate-mempool-balance': boolean; + 'dangerous': { + /** clear database storage */ + 'clear-dbstorage': boolean; + }; + /** encodes items in a legacy way (as it was before dropping generics) (default true) */ + 'legacy-storage-encoding': boolean; + /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 10) */ + 'max-mempool-transactions': number; + /** the maximum number of unconfirmed transactions to track at once (0 = unlimited) */ + 'max-queued-transactions': number; + /** the maximum tip cap to post transactions at (default 5) */ + 'max-tip-cap-gwei': number; + /** the minimum fee cap to post transactions at */ + 'min-fee-cap-gwei': number; + /** the minimum tip cap to post transactions at (default 0.05) */ + 'min-tip-cap-gwei': number; + /** the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee (default 1) */ + 'nonce-rbf-soft-confs': number; + 'redis-signer': { + 'dangerous': { + /** disable message signature verification */ + 'disable-signature-verification': boolean; + }; + /** a fallback key used for message verification */ + 'fallback-verification-key': string; + /** a 32-byte (64-character) hex string used to sign messages, or a path to a file containing it */ + 'signing-key': string; + }; + /** comma-separated list of durations since first posting to attempt a replace-by-fee (default "5m,10m,20m,30m,1h,2h,4h,6h,8h,12h,16h,18h,20h,22h") */ + 'replacement-times': string; + /** the target price to use for maximum fee cap calculation (default 60) */ + 'target-price-gwei': number; + /** the urgency to use for maximum fee cap calculation (default 2) */ + 'urgency-gwei': number; + /** uses database storage when enabled (default true) */ + 'use-db-storage': boolean; + /** uses noop storage, it doesn't store anything */ + 'use-noop-storage': boolean; + /** only treat a transaction as confirmed after L1 finality has been achieved (recommended) (default true) */ + 'wait-for-l1-finality': boolean; + }; + /** If unable to batch to DAS, disable fallback storing data on chain */ + 'disable-das-fallback-store-data-on-chain': boolean; + /** enable posting batches to l1 */ + 'enable': boolean; + /** how long to delay after error posting batch (default 10s) */ + 'error-delay': number; + /** use this much more gas than estimation says is necessary to post batches (default 50000) */ + 'extra-batch-gas': number; + /** The gas refunder contract address (optional) */ + 'gas-refunder-address': string; + /** only post messages to batches when they're within the max future block/timestamp as of this L1 block tag ("safe", "finalized", "latest", or "ignore" to ignore this check) */ + 'l1-block-bound': string; + /** post batches even if not within the layer 1 future bounds if we're within this margin of the max delay (default 1h0m0s) */ + 'l1-block-bound-bypass': number; + /** maximum batch posting delay (default 1h0m0s) */ + 'max-delay': number; + /** maximum batch size (default 100000) */ + 'max-size': number; + 'parent-chain-wallet': { + /** account to use (default is first account in keystore) */ + 'account': string; + /** if true, creates new key then exits */ + 'only-create-key': boolean; + /** wallet passphrase (default "PASSWORD_NOT_SET") */ + 'password': string; + /** pathname for wallet (default "batch-poster-wallet") */ + 'pathname': string; + /** private key for wallet */ + 'private-key': string; + }; + /** how long to wait after no batches are ready to be posted before checking again (default 10s) */ + 'poll-interval': number; + 'redis-lock': { + /** should node always try grabing lock in background */ + 'background-lock': boolean; + /** key for lock (default "node.batch-poster.redis-lock.simple-lock-key") */ + 'key': string; + /** how long lock is held (default 1m0s) */ + 'lockout-duration': number; + /** this node's id prefix when acquiring the lock (optional) */ + 'my-id': string; + /** how long between consecutive calls to redis (default 10s) */ + 'refresh-duration': number; + }; + /** if non-empty, the Redis URL to store queued transactions in */ + 'redis-url': string; + /** wait for the max batch delay, even if the batch is full */ + 'wait-for-max-delay': boolean; + }; + 'block-validator': { + /** current wasm module root ('current' read from chain, 'latest' from machines/latest dir, or provide hash) (default "current") */ + 'current-module-root': string; + 'dangerous': { + /** resets block-by-block validation, starting again at genesis */ + 'reset-block-validation': boolean; + }; + /** enable block-by-block validation */ + 'enable': boolean; + /** failing a validation is treated as a fatal error (default true) */ + 'failure-is-fatal': boolean; + /** prepare entries for up to that many blocks ahead of validation (small footprint) (default 1024) */ + 'forward-blocks': number; + /** pending upgrade wasm module root to additionally validate (hash, 'latest' or empty) (default "latest") */ + 'pending-upgrade-module-root': string; + /** record that many blocks ahead of validation (larger footprint) (default 128) */ + 'prerecorded-blocks': number; + /** poll time to check validations (default 1s) */ + 'validation-poll': number; + 'validation-server': { + /** limit size of arguments in log entries (default 2048) */ + 'arg-log-limit': number; + /** how long to wait for initial connection */ + 'connection-wait': number; + /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ + 'jwtsecret': string; + /** number of retries in case of failure(0 mean one attempt) */ + 'retries': number; + /** Errors matching this regular expression are automatically retried */ + 'retry-errors': string; + /** per-response timeout (0-disabled) */ + 'timeout': number; + /** url of server, use self for loopback websocket, self-auth for loopback with authentication (default "self-auth") */ + 'url': string; + }; + }; + 'caching': { + /** retain past block state */ + 'archive': boolean; + /** minimum age of recent blocks to keep in memory (default 30m0s) */ + 'block-age': number; + /** minimum number of recent blocks to keep in memory (default 128) */ + 'block-count': number; + /** amount of memory in megabytes to cache database contents with (default 2048) */ + 'database-cache': number; + /** maximum amount of gas in blocks to skip saving state to Persistent storage (archive node only) -- warning: this option seems to cause issues */ + 'max-amount-of-gas-to-skip-state-saving': number; + /** maximum number of blocks to skip state saving to persistent storage (archive node only) -- warning: this option seems to cause issues */ + 'max-number-of-blocks-to-skip-state-saving': number; + /** amount of memory in megabytes to cache state snapshots with (default 400) */ + 'snapshot-cache': number; + /** maximum gas rolled back to recover snapshot (default 300000000000) */ + 'snapshot-restore-gas-limit': number; + /** amount of memory in megabytes to cache unchanged state trie nodes with (default 600) */ + 'trie-clean-cache': number; + /** amount of memory in megabytes to cache state diffs against disk with (larger cache lowers database growth) (default 1024) */ + 'trie-dirty-cache': number; + /** maximum block processing time before trie is written to hard-disk (default 1h0m0s) */ + 'trie-time-limit': number; + }; + 'dangerous': { + /** DANGEROUS! disables listening to L1. To be used in test nodes only */ + 'no-l1-listener': boolean; + }; + 'data-availability': { + /** enable Anytrust Data Availability mode */ + 'enable': boolean; + 'ipfs-storage': { + /** enable storage/retrieval of sequencer batch data from IPFS */ + 'enable': boolean; + /** list of IPFS peers to connect to, eg /ip4/1.2.3.4/tcp/12345/p2p/abc...xyz */ + 'peers': string[]; + /** pin sequencer batch data in IPFS (default true) */ + 'pin-after-get': boolean; + /** percent of sequencer batch data to pin, as a floating point number in the range 0.0 to 100.0 (default 100) */ + 'pin-percentage': number; + /** comma separated list of IPFS profiles to use, see https://docs.ipfs.tech/how-to/default-profile */ + 'profiles': string; + /** timeout for IPFS reads, since by default it will wait forever. Treat timeout as not found (default 1m0s) */ + 'read-timeout': number; + /** directory to use to store the local IPFS repo */ + 'repo-dir': string; + }; + /** whether the Data Availability Service should fail immediately on errors (not recommended) */ + 'panic-on-error': boolean; + /** layer 1 RPC connection attempts (spaced out at least 1 second per attempt, 0 to retry infinitely), only used in standalone daserver; when running as part of a node that node's L1 configuration is used (default 15) */ + 'parent-chain-connection-attempts': number; + /** URL for L1 node, only used in standalone daserver; when running as part of a node that node's L1 configuration is used */ + 'parent-chain-node-url': string; + /** Data Availability Service timeout duration for Store requests (default 5s) */ + 'request-timeout': number; + 'rest-aggregator': { + /** enable retrieval of sequencer batch data from a list of remote REST endpoints; if other DAS storage types are enabled, this mode is used as a fallback */ + 'enable': boolean; + /** number of stats entries (latency and success rate) to keep for each REST endpoint; controls whether strategy is faster or slower to respond to changing conditions (default 20) */ + 'max-per-endpoint-stats': number; + /** a URL to a list of URLs of REST das endpoints that is checked at startup; additive with the url option */ + 'online-url-list': string; + /** time interval to periodically fetch url list from online-url-list (default 1h0m0s) */ + 'online-url-list-fetch-interval': number; + 'simple-explore-exploit-strategy': { + /** number of consecutive GetByHash calls to the aggregator where each call will cause it to select from REST endpoints in order of best latency and success rate, before switching to explore mode (default 1000) */ + 'exploit-iterations': number; + /** number of consecutive GetByHash calls to the aggregator where each call will cause it to randomly select from REST endpoints until one returns successfully, before switching to exploit mode (default 20) */ + 'explore-iterations': number; + }; + /** strategy to use to determine order and parallelism of calling REST endpoint URLs; valid options are 'simple-explore-exploit' (default "simple-explore-exploit") */ + 'strategy': string; + /** how frequently to update the strategy with endpoint latency and error rate data (default 10s) */ + 'strategy-update-interval': number; + 'sync-to-storage': { + /** check if the data already exists in this DAS's storage. Must be disabled for fast sync with an IPFS backend (default true) */ + 'check-already-exists': boolean; + /** time to wait if encountered an error before retrying (default 1s) */ + 'delay-on-error': number; + /** eagerly sync batch data to this DAS's storage from the rest endpoints, using L1 as the index of batch data hashes; otherwise only sync lazily */ + 'eager': boolean; + /** when eagerly syncing, start indexing forward from this L1 block. Only used if there is no sync state */ + 'eager-lower-bound-block': number; + /** log only on failures to write when syncing; otherwise treat it as an error (default true) */ + 'ignore-write-errors': boolean; + /** when eagerly syncing, max l1 blocks to read per poll (default 100) */ + 'parent-chain-blocks-per-read': number; + /** period to retain synced data (defaults to forever) (default 2562047h47m16.854775807s) */ + 'retention-period': number; + /** directory to store the sync state in, ie the block number currently synced up to, so that we don't sync from scratch each time */ + 'state-dir': string; + }; + /** list of URLs including 'http://' or 'https://' prefixes and port numbers to REST DAS endpoints; additive with the online-url-list option */ + 'urls': string[]; + /** time to wait until trying the next set of REST endpoints while waiting for a response; the next set of REST endpoints is determined by the strategy selected (default 2s) */ + 'wait-before-try-next': number; + }; + 'rpc-aggregator': { + /** Number of assumed honest backends (H). If there are N backends, K=N+1-H valid responses are required to consider an Store request to be successful. */ + 'assumed-honest': number; + /** JSON RPC backend configuration */ + 'backends': string; + /** enable storage/retrieval of sequencer batch data from a list of RPC endpoints; this should only be used by the batch poster and not in combination with other DAS storage types */ + 'enable': boolean; + }; + /** L1 address of SequencerInbox contract */ + 'sequencer-inbox-address': string; + }; + 'delayed-sequencer': { + /** enable delayed sequencer */ + 'enable': boolean; + /** how many blocks in the past L1 block is considered final (ignored when using Merge finality) (default 20) */ + 'finalize-distance': number; + /** whether to wait for full finality before sequencing delayed messages */ + 'require-full-finality': boolean; + /** whether to use The Merge's notion of finality before sequencing delayed messages (default true) */ + 'use-merge-finality': boolean; + }; + 'feed': { + input: { + /** enable per message deflate compression support (default true) */ + 'enable-compression': boolean; + /** initial duration to wait before reconnect (default 1s) */ + 'reconnect-initial-backoff': number; + /** maximum duration to wait before reconnect (default 1m4s) */ + 'reconnect-maximum-backoff': number; + /** require chain id to be present on connect */ + 'require-chain-id': boolean; + /** require feed version to be present on connect */ + 'require-feed-version': boolean; + /** duration to wait before timing out connection to sequencer feed (default 20s) */ + 'timeout': number; + /** URL of sequencer feed source */ + 'url': string[]; + 'verify': { + /** accept verified message from sequencer (default true) */ + 'accept-sequencer': boolean; + /** a list of allowed addresses */ + 'allowed-addresses': string[]; + 'dangerous': { + /** accept empty as valid signature (default true) */ + 'accept-missing': boolean; + }; + }; + }; + output: { + /** address to bind the relay feed output to */ + 'addr': string; + /** delay the first messages sent to each client by this amount */ + 'client-delay': number; + /** duration to wait before timing out connections to client (default 15s) */ + 'client-timeout': number; + 'connection-limits': { + /** enable broadcaster per-client connection limiting */ + 'enable': boolean; + /** limit clients, as identified by IPv4/v6 address, to this many connections to this relay (default 5) */ + 'per-ip-limit': number; + /** limit ipv6 clients, as identified by IPv6 address masked with /48, to this many connections to this relay (default 20) */ + 'per-ipv6-cidr-48-limit': number; + /** limit ipv6 clients, as identified by IPv6 address masked with /64, to this many connections to this relay (default 10) */ + 'per-ipv6-cidr-64-limit': number; + /** time to wait after a relay client disconnects before the disconnect is registered with respect to the limit for this client */ + 'reconnect-cooldown-period': number; + }; + /** don't sign feed messages (default true) */ + 'disable-signing': boolean; + /** enable broadcaster */ + 'enable': boolean; + /** enable per message deflate compression support (default true) */ + 'enable-compression': boolean; + /** duration to wait before timing out HTTP to WS upgrade (default 1s) */ + 'handshake-timeout': number; + /** only supply catchup buffer if requested sequence number is reasonable */ + 'limit-catchup': boolean; + /** log every client connect */ + 'log-connect': boolean; + /** log every client disconnect */ + 'log-disconnect': boolean; + /** the maximum size of the catchup buffer (-1 means unlimited) (default -1) */ + 'max-catchup': number; + /** maximum number of messages allowed to accumulate before client is disconnected (default 4096) */ + 'max-send-queue': number; + /** duration for ping interval (default 5s) */ + 'ping': number; + /** port to bind the relay feed output to (default "9642") */ + 'port': string; + /** queue size for HTTP to WS upgrade (default 100) */ + 'queue': number; + /** duration to wait before timing out reading data (i.e. pings) from clients (default 1s) */ + 'read-timeout': number; + /** require clients to use compression */ + 'require-compression': boolean; + /** don't connect if client version not present */ + 'require-version': boolean; + /** sign broadcast messages */ + 'signed': boolean; + /** number of threads to reserve for HTTP to WS upgrade (default 100) */ + 'workers': number; + /** duration to wait before timing out writing data to clients (default 2s) */ + 'write-timeout': number; + }; + }; + 'forwarder': { + /** total time to wait before cancelling connection (default 30s) */ + 'connection-timeout': number; + /** time until idle connections are closed (default 15s) */ + 'idle-connection-timeout': number; + /** maximum number of idle connections to keep open (default 1) */ + 'max-idle-connections': number; + /** the Redis URL to recomend target via */ + 'redis-url': string; + /** minimal time between update retries (default 100ms) */ + 'retry-interval': number; + /** forwarding target update interval (default 1s) */ + 'update-interval': number; + }; + /** transaction forwarding target URL, or "null" to disable forwarding (if not sequencer) */ + 'forwarding-target': string; + 'inbox-reader': { + /** the maximum time to wait between inbox checks (if not enough new blocks are found) (default 1m0s) */ + 'check-delay': number; + /** the default number of blocks to read at once (will vary based on traffic by default) (default 100) */ + 'default-blocks-to-read': number; + /** number of latest blocks to ignore to reduce reorgs */ + 'delay-blocks': number; + /** erase future transactions in addition to overwriting existing ones on reorg */ + 'hard-reorg': boolean; + /** if adjust-blocks-to-read is enabled, the maximum number of blocks to read at once (default 2000) */ + 'max-blocks-to-read': number; + /** the minimum number of blocks to read at once (when caught up lowers load on L1) (default 1) */ + 'min-blocks-to-read': number; + /** if adjust-blocks-to-read is enabled, the target number of messages to read at once (default 500) */ + 'target-messages-read': number; + }; + 'maintenance': { + 'lock': { + /** should node always try grabing lock in background */ + 'background-lock': boolean; + /** key for lock (default "node.maintenance.lock.simple-lock-key") */ + 'key': string; + /** how long lock is held (default 1m0s) */ + 'lockout-duration': number; + /** this node's id prefix when acquiring the lock (optional) */ + 'my-id': string; + /** how long between consecutive calls to redis (default 10s) */ + 'refresh-duration': number; + }; + /** UTC 24-hour time of day to run maintenance (currently only db compaction) at (e.g. 15:00) */ + 'time-of-day': string; + }; + 'message-pruner': { + /** enable message pruning (default true) */ + 'enable': boolean; + /** min number of batches not pruned (default 2) */ + 'min-batches-left': number; + /** interval for running message pruner (default 1m0s) */ + 'prune-interval': number; + }; + 'parent-chain-reader': { + /** enable reader connection (default true) */ + 'enable': boolean; + /** warns if the latest l1 block is at least this old (default 5m0s) */ + 'old-header-timeout': number; + /** interval when polling endpoint (default 15s) */ + 'poll-interval': number; + /** do not attempt to subscribe to header events */ + 'poll-only': boolean; + /** timeout when waiting for a transaction (default 5m0s) */ + 'tx-timeout': number; + /** use l1 data about finalized/safe blocks (default true) */ + 'use-finality-data': boolean; + }; + 'recording-database': { + /** like trie-clean-cache for the separate, recording database (used for validation) (default 16) */ + 'trie-clean-cache': number; + /** like trie-dirty-cache for the separate, recording database (used for validation) (default 1024) */ + 'trie-dirty-cache': number; + }; + 'resource-mgmt': { + /** RPC calls are throttled if free system memory excluding the page cache is below this amount, expressed in bytes or multiples of bytes with suffix B, K, M, G. The limit should be set such that sufficient free memory is left for the page cache in order for the system to be performant */ + 'mem-free-limit': string; + }; + 'rpc': { + 'arbdebug': { + /** bounds the number of blocks arbdebug calls may return (default 256) */ + 'block-range-bound': number; + /** bounds the length of timeout queues arbdebug calls may return (default 512) */ + 'timeout-queue-bound': number; + }; + /** number of blocks a single bloom bit section vector holds (default 16384) */ + 'bloom-bits-blocks': number; + /** number of confirmation blocks before a bloom section is considered final (default 256) */ + 'bloom-confirms': number; + /** url to redirect classic requests, use "error:[CODE:]MESSAGE" to return specified error instead of redirecting */ + 'classic-redirect': string; + /** timeout for forwarded classic requests, where 0 = no timeout */ + 'classic-redirect-timeout': number; + /** timeout used for eth_call (0=infinite) (default 5s) */ + 'evm-timeout': number; + /** max number of blocks a fee history request may cover (default 1024) */ + 'feehistory-max-block-count': number; + /** log filter system maximum number of cached blocks (default 32) */ + 'filter-log-cache-size': number; + /** log filter system maximum time filters stay active (default 5m0s) */ + 'filter-timeout': number; + /** cap on computation gas that can be used in eth_call/estimateGas (0=infinite) (default 50000000) */ + 'gas-cap': number; + /** maximum depth for recreating state, measured in l2 gas (0=don't recreate state, -1=infinite, -2=use default value for archive or non-archive node (whichever is configured)) (default -2) */ + 'max-recreate-state-depth': number; + /** allow transactions that aren't EIP-155 replay protected to be submitted over the RPC (default true) */ + 'tx-allow-unprotected': boolean; + /** cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) */ + 'tx-fee-cap': number; + }; + 'seq-coordinator': { + /** if non-empty, launch an HTTP service binding to this address that returns status code 200 when chosen and 503 otherwise */ + 'chosen-healthcheck-addr': string; + /** enable sequence coordinator */ + 'enable': boolean; + /** the maximum amount of time to spend waiting for another sequencer to accept the lockout when handing it off on shutdown or db compaction (default 30s) */ + 'handoff-timeout': number; + /** (default 1m0s) */ + 'lockout-duration': number; + /** (default 30s) */ + 'lockout-spare': number; + /** will only be marked as wanting the lockout if not too far behind (default 2000) */ + 'msg-per-poll': number; + /** url for this sequencer if it is the chosen (default "") */ + 'my-url': string; + /** the Redis URL to coordinate via */ + 'redis-url': string; + /** the number of times to retry releasing the wants lockout and chosen one status on shutdown (default 4) */ + 'release-retries': number; + /** (default 50ms) */ + 'retry-interval': number; + /** if non-zero will add delay after transferring control (default 5s) */ + 'safe-shutdown-delay': number; + /** (default 24h0m0s) */ + 'seq-num-duration': number; + 'signer': { + 'ecdsa': { + /** accept verified message from sequencer (default true) */ + 'accept-sequencer': boolean; + /** a list of allowed addresses */ + 'allowed-addresses': string[]; + 'dangerous': { + /** accept empty as valid signature (default true) */ + 'accept-missing': boolean; + }; + }; + /** if to fall back to symmetric hmac */ + 'symmetric-fallback': boolean; + /** if to sign with symmetric hmac */ + 'symmetric-sign': boolean; + 'symmetric': { + 'dangerous': { + /** disable message signature verification */ + 'disable-signature-verification': boolean; + }; + /** a fallback key used for message verification */ + 'fallback-verification-key': string; + /** a 32-byte (64-character) hex string used to sign messages, or a path to a file containing it */ + 'signing-key': string; + }; + }; + /** (default 250ms) */ + 'update-interval': number; + }; + 'sequencer': { + 'dangerous': { + /** DANGEROUS! allows sequencer without coordinator. */ + 'no-coordinator': boolean; + }; + /** act and post to l1 as sequencer */ + 'enable': boolean; + 'forwarder': { + /** total time to wait before cancelling connection (default 30s) */ + 'connection-timeout': number; + /** time until idle connections are closed (default 1m0s) */ + 'idle-connection-timeout': number; + /** maximum number of idle connections to keep open (default 100) */ + 'max-idle-connections': number; + /** the Redis URL to recomend target via */ + 'redis-url': string; + /** minimal time between update retries (default 100ms) */ + 'retry-interval': number; + /** forwarding target update interval (default 1s) */ + 'update-interval': number; + }; + /** maximum acceptable time difference between the local time and the latest L1 block's timestamp (default 1h0m0s) */ + 'max-acceptable-timestamp-delta': number; + /** minimum delay between blocks (sets a maximum speed of block production) (default 100ms) */ + 'max-block-speed': number; + /** maximum gas executed in a revert for the sequencer to reject the transaction instead of posting it (anti-DOS) (default 31000) */ + 'max-revert-gas-reject': number; + /** maximum transaction size the sequencer will accept (default 95000) */ + 'max-tx-data-size': number; + /** size of the tx sender nonce cache (default 1024) */ + 'nonce-cache-size': number; + /** maximum amount of time to wait for a predecessor before rejecting a tx with nonce too high (default 1s) */ + 'nonce-failure-cache-expiry': number; + /** number of transactions with too high of a nonce to keep in memory while waiting for their predecessor (default 1024) */ + 'nonce-failure-cache-size': number; + /** size of the pending tx queue (default 1024) */ + 'queue-size': number; + /** maximum amount of time transaction can wait in queue (default 12s) */ + 'queue-timeout': number; + /** comma separated whitelist of authorized senders (if empty, everyone is allowed) */ + 'sender-whitelist': string; + }; + 'staker': { + /** confirmation blocks (default 12) */ + 'confirmation-blocks': number; + /** validator smart contract wallet public address */ + 'contract-wallet-address': string; + 'dangerous': { + /** DANGEROUS! make assertions even when the wasm module root is wrong */ + 'ignore-rollup-wasm-module-root': boolean; + /** DANGEROUS! allows running an L1 validator without a block validator */ + 'without-block-validator': boolean; + }; + 'data-poster': { + /** if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance (default true) */ + 'allocate-mempool-balance': boolean; + 'dangerous': { + /** clear database storage */ + 'clear-dbstorage': boolean; + }; + /** encodes items in a legacy way (as it was before dropping generics) (default true) */ + 'legacy-storage-encoding': boolean; + /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 10) */ + 'max-mempool-transactions': number; + /** the maximum number of unconfirmed transactions to track at once (0 = unlimited) */ + 'max-queued-transactions': number; + /** the maximum tip cap to post transactions at (default 5) */ + 'max-tip-cap-gwei': number; + /** the minimum fee cap to post transactions at */ + 'min-fee-cap-gwei': number; + /** the minimum tip cap to post transactions at (default 0.05) */ + 'min-tip-cap-gwei': number; + /** the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee (default 1) */ + 'nonce-rbf-soft-confs': number; + 'redis-signer': { + 'dangerous': { + /** disable message signature verification */ + 'disable-signature-verification': boolean; + }; + /** a fallback key used for message verification */ + 'fallback-verification-key': string; + /** a 32-byte (64-character) hex string used to sign messages, or a path to a file containing it */ + 'signing-key': string; + }; + /** comma-separated list of durations since first posting to attempt a replace-by-fee (default "5m,10m,20m,30m,1h,2h,4h,6h,8h,12h,16h,18h,20h,22h") */ + 'replacement-times': string; + /** the target price to use for maximum fee cap calculation (default 60) */ + 'target-price-gwei': number; + /** the urgency to use for maximum fee cap calculation (default 2) */ + 'urgency-gwei': number; + /** uses database storage when enabled (default true) */ + 'use-db-storage': boolean; + /** uses noop storage, it doesn't store anything */ + 'use-noop-storage': boolean; + /** only treat a transaction as confirmed after L1 finality has been achieved (recommended) (default true) */ + 'wait-for-l1-finality': boolean; + }; + /** disable validator challenge */ + 'disable-challenge': boolean; + /** enable validator (default true) */ + 'enable': boolean; + /** use this much more gas than estimation says is necessary to post transactions (default 50000) */ + 'extra-gas': number; + /** The gas refunder contract address (optional) */ + 'gas-refunder-address': string; + /** if configured with the makeNodes strategy, how often to create new assertions (bypassed in case of a dispute) (default 1h0m0s) */ + 'make-assertion-interval': number; + /** only create smart wallet contract and exit */ + 'only-create-wallet-contract': boolean; + 'parent-chain-wallet': { + /** account to use (default is first account in keystore) */ + 'account': string; + /** if true, creates new key then exits */ + 'only-create-key': boolean; + /** wallet passphrase (default "PASSWORD_NOT_SET") */ + 'password': string; + /** pathname for wallet (default "validator-wallet") */ + 'pathname': string; + /** private key for wallet */ + 'private-key': string; + }; + 'posting-strategy': { + /** high gas delay blocks */ + 'high-gas-delay-blocks': number; + /** high gas threshold */ + 'high-gas-threshold': number; + }; + 'redis-lock': { + /** should node always try grabing lock in background */ + 'background-lock': boolean; + /** key for lock (default "node.staker.redis-lock.simple-lock-key") */ + 'key': string; + /** how long lock is held (default 1m0s) */ + 'lockout-duration': number; + /** this node's id prefix when acquiring the lock (optional) */ + 'my-id': string; + /** how long between consecutive calls to redis (default 10s) */ + 'refresh-duration': number; + }; + /** redis url for L1 validator */ + 'redis-url': string; + /** how often the L1 validator should check the status of the L1 rollup and maybe take action with its stake (default 1m0s) */ + 'staker-interval': number; + /** assume staked nodes are valid (default true) */ + 'start-validation-from-staked': boolean; + /** L1 validator strategy, either watchtower, defensive, stakeLatest, or makeNodes (default "Watchtower") */ + 'strategy': string; + /** use a smart contract wallet instead of an EOA address */ + 'use-smart-contract-wallet': boolean; + }; + 'sync-monitor': { + /** allowed lag between messages read and blocks built (default 20) */ + 'block-build-lag': number; + /** allowed lag between messages read from sequencer inbox and blocks built */ + 'block-build-sequencer-inbox-lag': number; + /** allowed lag between local and remote messages (default 15) */ + 'coordinator-msg-lag': number; + }; + 'transaction-streamer': { + /** delay when polling calls to execute messages (default 100ms) */ + 'execute-message-loop-delay': number; + /** maximum cache of pending broadcaster messages (default 1024) */ + 'max-broadcaster-queue-size': number; + /** maximum number of messages to attempt to resequence on reorg (0 = never resequence, -1 = always resequence) (default 1024) */ + 'max-reorg-resequence-depth': number; + }; + /** retain the ability to lookup transactions by hash for the past N blocks (0 = all blocks) (default 126230400) */ + 'tx-lookup-limit': number; + 'tx-pre-checker': { + /** how long ago should the storage conditions from eth_SendRawTransactionConditional be true, 0 = don't check old state (default 2) */ + 'required-state-age': number; + /** maximum number of blocks to look back while looking for the seconds old state, 0 = don't limit the search (default 4) */ + 'required-state-max-blocks': number; + /** how strict to be when checking txs before forwarding them. 0 = accept anything, 10 = should never reject anything that'd succeed, 20 = likely won't reject anything that'd succeed, 30 = full validation which may reject txs that would succeed */ + 'strictness': number; + }; + }; + 'parent-chain': { + connection: { + /** limit size of arguments in log entries */ + 'arg-log-limit': number; + /** how long to wait for initial connection (default 1m0s) */ + 'connection-wait': number; + /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ + 'jwtsecret': string; + /** number of retries in case of failure(0 mean one attempt) (default 2) */ + 'retries': number; + /** Errors matching this regular expression are automatically retried */ + 'retry-errors': string; + /** per-response timeout (0-disabled) (default 1m0s) */ + 'timeout': number; + /** url of server, use self for loopback websocket, self-auth for loopback with authentication */ + 'url': string; + }; + /** if set other than 0, will be used to validate database and L1 connection */ + id: number; + wallet: { + /** account to use (default is first account in keystore) */ + 'account': string; + /** if true, creates new key then exits */ + 'only-create-key': boolean; + /** wallet passphrase (default "PASSWORD_NOT_SET") */ + 'password': string; + /** pathname for wallet (default "wallet") */ + 'pathname': string; + /** private key for wallet */ + 'private-key': string; + }; + }; + 'persistent': { + /** directory of ancient where the chain freezer can be opened */ + 'ancient': string; + /** directory to store chain state */ + 'chain': string; + /** backing database implementation to use ('leveldb' or 'pebble') (default "leveldb") */ + 'db-engine': string; + /** directory to store global config (default ".arbitrum") */ + 'global-config': string; + /** number of file descriptor handles to use for the database (default 512) */ + 'handles': number; + /** directory to store log file */ + 'log-dir': string; + }; + /** enable pprof */ + 'pprof': boolean; + 'pprof-cfg': { + /** pprof server address (default "127.0.0.1") */ + addr: string; + /** pprof server port (default 6071) */ + port: number; + }; + 'rpc': { + /** the maximum response size for a JSON-RPC request measured in bytes (-1 means no limit) (default 10000000) */ + 'max-batch-response-size': number; + }; + 'validation': { + /** validate is an authenticated API (default true) */ + 'api-auth': boolean; + /** validate is a public API */ + 'api-public': boolean; + 'arbitrator': { + /** timeout before discarding execution run (default 15m0s) */ + 'execution-run-timeout': number; + 'execution': { + /** how many machines to store in cache while working on a challenge (should be even) (default 4) */ + 'cached-challenge-machines': number; + /** initial steps between machines (default 100000) */ + 'initial-steps': number; + }; + /** path to write machines to (default "./target/output") */ + 'output-path': string; + /** number of concurrent validation threads */ + 'workers': number; + }; + 'jit': { + /** use Cranelift instead of LLVM when validating blocks using the jit-accelerated block validator (default true) */ + cranelift: boolean; + /** number of concurrent validation threads */ + workers: number; + }; + /** use jit for validation (default true) */ + 'use-jit': boolean; + 'wasm': { + /** path to machine folders, each containing wasm files (machine.wavm.br, replay.wasm) */ + 'root-path': string; + }; + }; + 'ws': { + /** WS-RPC server listening interface */ + 'addr': string; + /** APIs offered over the WS-RPC interface (default [net,web3,eth,arb]) */ + 'api': string[]; + /** expose private api via websocket */ + 'expose-all': boolean; + /** Origins from which to accept websockets requests */ + 'origins': string[]; + /** WS-RPC server listening port (default 8548) */ + 'port': number; + /** WS path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ + 'rpcprefix': string; + }; +}; diff --git a/yarn.lock b/yarn.lock index 50fd42ff..7bc3375d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -304,6 +304,16 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== +"@ts-morph/common@~0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.22.0.tgz#8951d451622a26472fbc3a227d6c3a90e687a683" + integrity sha512-HqNBuV/oIlMKdkLshXd1zKBqNQCsuPEsgQOkfFQ/eUKjRlwndXW1AjN9LVkBEIukm00gGXSRmfkl0Wv5VXLnlw== + dependencies: + fast-glob "^3.3.2" + minimatch "^9.0.3" + mkdirp "^3.0.1" + path-browserify "^1.0.1" + "@types/chai-subset@^1.3.3": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.5.tgz#3fc044451f26985f45625230a7f22284808b0a9a" @@ -493,6 +503,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -634,6 +651,11 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== +code-block-writer@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" + integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -837,7 +859,7 @@ execa@^6.1.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -fast-glob@^3.3.0: +fast-glob@^3.3.0, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -1253,11 +1275,23 @@ minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +mkdirp@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" + integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== + mlly@^1.2.0, mlly@^1.4.0: version "1.4.2" resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.4.2.tgz#7cf406aa319ff6563d25da6b36610a93f2a8007e" @@ -1424,6 +1458,11 @@ patch-package@^8.0.0: tmp "^0.0.33" yaml "^2.2.2" +path-browserify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + path-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f" @@ -1734,6 +1773,14 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +ts-morph@^21.0.1: + version "21.0.1" + resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-21.0.1.tgz#712302a0f6e9dbf1aa8d9cf33a4386c4b18c2006" + integrity sha512-dbDtVdEAncKctzrVZ+Nr7kHpHkv+0JDJb2MjjpBaj8bFeCkePU9rHfMklmhuLFnpeq/EJZk2IhStY6NzqgjOkg== + dependencies: + "@ts-morph/common" "~0.22.0" + code-block-writer "^12.0.0" + tslib@^2.0.3: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" From 848cd7095af4822590b229f4f31e4c3abbc30578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 16:31:39 +0100 Subject: [PATCH 03/20] make everything optional --- src/scripts/generateNodeConfigType.ts | 2 + src/types/NodeConfig-Generated.ts | 948 +++++++++++++------------- 2 files changed, 476 insertions(+), 474 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index 681414cc..f40e2a4d 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -120,6 +120,8 @@ function getType(something: any) { type: getType(value), //@ts-ignore docs: value.docs, + // make it optional + hasQuestionToken: true, })), }); } diff --git a/src/types/NodeConfig-Generated.ts b/src/types/NodeConfig-Generated.ts index 04aa80c4..298317d6 100644 --- a/src/types/NodeConfig-Generated.ts +++ b/src/types/NodeConfig-Generated.ts @@ -3,955 +3,955 @@ // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // // IMAGE: offchainlabs/nitro-node:v2.1.2-4c55843-dev -// TIMESTAMP: 2024-01-05T15:18:30.648Z +// TIMESTAMP: 2024-01-05T15:31:26.250Z // // --- /** Nitro node configuration options */ export type NodeConfig = { - 'auth': { + 'auth'?: { /** AUTH-RPC server listening interface (default "127.0.0.1") */ - addr: string; + addr?: string; /** APIs offered over the AUTH-RPC interface (default [validation]) */ - api: string[]; + api?: string[]; /** Path to file holding JWT secret (32B hex) */ - jwtsecret: string; + jwtsecret?: string; /** Origins from which to accept AUTH requests (default [localhost]) */ - origins: string[]; + origins?: string[]; /** AUTH-RPC server listening port (default 8549) */ - port: number; + port?: number; }; - 'chain': { - 'dev-wallet': { + 'chain'?: { + 'dev-wallet'?: { /** account to use (default is first account in keystore) */ - 'account': string; + 'account'?: string; /** if true, creates new key then exits */ - 'only-create-key': boolean; + 'only-create-key'?: boolean; /** wallet passphrase (default "PASSWORD_NOT_SET") */ - 'password': string; + 'password'?: string; /** pathname for wallet */ - 'pathname': string; + 'pathname'?: string; /** private key for wallet */ - 'private-key': string; + 'private-key'?: string; }; /** L2 chain ID (determines Arbitrum network) */ - 'id': number; + 'id'?: number; /** L2 chain info json files */ - 'info-files': string[]; + 'info-files'?: string[]; /** path to save temp downloaded file (default "/tmp/") */ - 'info-ipfs-download-path': string; + 'info-ipfs-download-path'?: string; /** url to download chain info file */ - 'info-ipfs-url': string; + 'info-ipfs-url'?: string; /** L2 chain info in json string format */ - 'info-json': string; + 'info-json'?: string; /** L2 chain name (determines Arbitrum network) */ - 'name': string; + 'name'?: string; }; - 'conf': { + 'conf'?: { /** print out currently active configuration file */ - 'dump': boolean; + 'dump'?: boolean; /** environment variables with given prefix will be loaded as configuration values */ - 'env-prefix': string; + 'env-prefix'?: string; /** name of configuration file */ - 'file': string[]; + 'file'?: string[]; /** how often to reload configuration (0=disable periodic reloading) */ - 'reload-interval': number; - 's3': { + 'reload-interval'?: number; + 's3'?: { /** S3 access key */ - 'access-key': string; + 'access-key'?: string; /** S3 bucket */ - 'bucket': string; + 'bucket'?: string; /** S3 object key */ - 'object-key': string; + 'object-key'?: string; /** S3 region */ - 'region': string; + 'region'?: string; /** S3 secret key */ - 'secret-key': string; + 'secret-key'?: string; }; /** configuration as JSON string */ - 'string': string; + 'string'?: string; }; - 'file-logging': { + 'file-logging'?: { /** size of intermediate log records buffer (default 512) */ - 'buf-size': number; + 'buf-size'?: number; /** enable compression of old log files (default true) */ - 'compress': boolean; + 'compress'?: boolean; /** enable logging to file (default true) */ - 'enable': boolean; + 'enable'?: boolean; /** path to log file (default "nitro.log") */ - 'file': string; + 'file'?: string; /** if true: local time will be used in old log filename timestamps */ - 'local-time': boolean; + 'local-time'?: boolean; /** maximum number of days to retain old log files based on the timestamp encoded in their filename (0 = no limit) */ - 'max-age': number; + 'max-age'?: number; /** maximum number of old log files to retain (0 = no limit) (default 20) */ - 'max-backups': number; + 'max-backups'?: number; /** log file size in Mb that will trigger log file rotation (0 = trigger disabled) (default 5) */ - 'max-size': number; + 'max-size'?: number; }; - 'graphql': { + 'graphql'?: { /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ - corsdomain: string[]; + corsdomain?: string[]; /** Enable graphql endpoint on the rpc endpoint */ - enable: boolean; + enable?: boolean; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ - vhosts: string[]; + vhosts?: string[]; }; - 'http': { + 'http'?: { /** HTTP-RPC server listening interface */ - 'addr': string; + 'addr'?: string; /** APIs offered over the HTTP-RPC interface (default [net,web3,eth,arb]) */ - 'api': string[]; + 'api'?: string[]; /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ - 'corsdomain': string[]; + 'corsdomain'?: string[]; /** HTTP-RPC server listening port (default 8547) */ - 'port': number; + 'port'?: number; /** HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ - 'rpcprefix': string; - 'server-timeouts': { + 'rpcprefix'?: string; + 'server-timeouts'?: { /** the maximum amount of time to wait for the next request when keep-alives are enabled (http.Server.IdleTimeout) (default 2m0s) */ - 'idle-timeout': number; + 'idle-timeout'?: number; /** the amount of time allowed to read the request headers (http.Server.ReadHeaderTimeout) (default 30s) */ - 'read-header-timeout': number; + 'read-header-timeout'?: number; /** the maximum duration for reading the entire request (http.Server.ReadTimeout) (default 30s) */ - 'read-timeout': number; + 'read-timeout'?: number; /** the maximum duration before timing out writes of the response (http.Server.WriteTimeout) (default 30s) */ - 'write-timeout': number; + 'write-timeout'?: number; }; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ - 'vhosts': string[]; + 'vhosts'?: string[]; }; - 'init': { + 'init'?: { /** during init - sync database every X accounts. Lower value for low-memory systems. 0 disables. (default 100000) */ - 'accounts-per-sync': number; + 'accounts-per-sync'?: number; /** init with dev data (1 account with balance) instead of file import */ - 'dev-init': boolean; + 'dev-init'?: boolean; /** Address of dev-account. Leave empty to use the dev-wallet. */ - 'dev-init-address': string; + 'dev-init-address'?: string; /** Number of preinit blocks. Must exist in ancient database. */ - 'dev-init-blocknum': number; + 'dev-init-blocknum'?: number; /** path to save temp downloaded file (default "/tmp/") */ - 'download-path': string; + 'download-path'?: string; /** how long to wait between polling attempts (default 1m0s) */ - 'download-poll': number; + 'download-poll'?: number; /** init with empty state */ - 'empty': boolean; + 'empty'?: boolean; /** if true: in case database exists init code will be reexecuted and genesis block compared to database */ - 'force': boolean; + 'force'?: boolean; /** path for json data to import */ - 'import-file': string; + 'import-file'?: string; /** pruning for a given use: "full" for full nodes serving RPC requests, or "validator" for validators */ - 'prune': string; + 'prune'?: string; /** the amount of memory in megabytes to use for the pruning bloom filter (higher values prune better) (default 2048) */ - 'prune-bloom-size': number; + 'prune-bloom-size'?: number; /** forces a reset to an old message height. Also set max-reorg-resequence-depth=0 to force re-reading messages (default -1) */ - 'reset-to-message': number; + 'reset-to-message'?: number; /** quit after init is done */ - 'then-quit': boolean; + 'then-quit'?: boolean; /** url to download initializtion data - will poll if download fails */ - 'url': string; + 'url'?: string; }; - 'ipc': { + 'ipc'?: { /** Requested location to place the IPC endpoint. An empty path disables IPC. */ - path: string; + path?: string; }; /** log level (default 3) */ - 'log-level': number; + 'log-level'?: number; /** log type (plaintext or json) (default "plaintext") */ - 'log-type': string; + 'log-type'?: string; /** enable metrics */ - 'metrics': boolean; - 'metrics-server': { + 'metrics'?: boolean; + 'metrics-server'?: { /** metrics server address (default "127.0.0.1") */ - 'addr': string; + 'addr'?: string; /** metrics server port (default 6070) */ - 'port': number; + 'port'?: number; /** metrics server update interval (default 3s) */ - 'update-interval': number; + 'update-interval'?: number; }; - 'node': { + 'node'?: { /** retain past block state (deprecated, please use node.caching.archive) */ - 'archive': boolean; - 'batch-poster': { + 'archive'?: boolean; + 'batch-poster'?: { /** batch compression level (default 11) */ - 'compression-level': number; + 'compression-level'?: number; /** In AnyTrust mode, the period which DASes are requested to retain the stored batches. (default 360h0m0s) */ - 'das-retention-period': number; - 'data-poster': { + 'das-retention-period'?: number; + 'data-poster'?: { /** if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance (default true) */ - 'allocate-mempool-balance': boolean; - 'dangerous': { + 'allocate-mempool-balance'?: boolean; + 'dangerous'?: { /** clear database storage */ - 'clear-dbstorage': boolean; + 'clear-dbstorage'?: boolean; }; /** encodes items in a legacy way (as it was before dropping generics) (default true) */ - 'legacy-storage-encoding': boolean; + 'legacy-storage-encoding'?: boolean; /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 10) */ - 'max-mempool-transactions': number; + 'max-mempool-transactions'?: number; /** the maximum number of unconfirmed transactions to track at once (0 = unlimited) */ - 'max-queued-transactions': number; + 'max-queued-transactions'?: number; /** the maximum tip cap to post transactions at (default 5) */ - 'max-tip-cap-gwei': number; + 'max-tip-cap-gwei'?: number; /** the minimum fee cap to post transactions at */ - 'min-fee-cap-gwei': number; + 'min-fee-cap-gwei'?: number; /** the minimum tip cap to post transactions at (default 0.05) */ - 'min-tip-cap-gwei': number; + 'min-tip-cap-gwei'?: number; /** the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee (default 1) */ - 'nonce-rbf-soft-confs': number; - 'redis-signer': { - 'dangerous': { + 'nonce-rbf-soft-confs'?: number; + 'redis-signer'?: { + 'dangerous'?: { /** disable message signature verification */ - 'disable-signature-verification': boolean; + 'disable-signature-verification'?: boolean; }; /** a fallback key used for message verification */ - 'fallback-verification-key': string; + 'fallback-verification-key'?: string; /** a 32-byte (64-character) hex string used to sign messages, or a path to a file containing it */ - 'signing-key': string; + 'signing-key'?: string; }; /** comma-separated list of durations since first posting to attempt a replace-by-fee (default "5m,10m,20m,30m,1h,2h,4h,6h,8h,12h,16h,18h,20h,22h") */ - 'replacement-times': string; + 'replacement-times'?: string; /** the target price to use for maximum fee cap calculation (default 60) */ - 'target-price-gwei': number; + 'target-price-gwei'?: number; /** the urgency to use for maximum fee cap calculation (default 2) */ - 'urgency-gwei': number; + 'urgency-gwei'?: number; /** uses database storage when enabled (default true) */ - 'use-db-storage': boolean; + 'use-db-storage'?: boolean; /** uses noop storage, it doesn't store anything */ - 'use-noop-storage': boolean; + 'use-noop-storage'?: boolean; /** only treat a transaction as confirmed after L1 finality has been achieved (recommended) (default true) */ - 'wait-for-l1-finality': boolean; + 'wait-for-l1-finality'?: boolean; }; /** If unable to batch to DAS, disable fallback storing data on chain */ - 'disable-das-fallback-store-data-on-chain': boolean; + 'disable-das-fallback-store-data-on-chain'?: boolean; /** enable posting batches to l1 */ - 'enable': boolean; + 'enable'?: boolean; /** how long to delay after error posting batch (default 10s) */ - 'error-delay': number; + 'error-delay'?: number; /** use this much more gas than estimation says is necessary to post batches (default 50000) */ - 'extra-batch-gas': number; + 'extra-batch-gas'?: number; /** The gas refunder contract address (optional) */ - 'gas-refunder-address': string; + 'gas-refunder-address'?: string; /** only post messages to batches when they're within the max future block/timestamp as of this L1 block tag ("safe", "finalized", "latest", or "ignore" to ignore this check) */ - 'l1-block-bound': string; + 'l1-block-bound'?: string; /** post batches even if not within the layer 1 future bounds if we're within this margin of the max delay (default 1h0m0s) */ - 'l1-block-bound-bypass': number; + 'l1-block-bound-bypass'?: number; /** maximum batch posting delay (default 1h0m0s) */ - 'max-delay': number; + 'max-delay'?: number; /** maximum batch size (default 100000) */ - 'max-size': number; - 'parent-chain-wallet': { + 'max-size'?: number; + 'parent-chain-wallet'?: { /** account to use (default is first account in keystore) */ - 'account': string; + 'account'?: string; /** if true, creates new key then exits */ - 'only-create-key': boolean; + 'only-create-key'?: boolean; /** wallet passphrase (default "PASSWORD_NOT_SET") */ - 'password': string; + 'password'?: string; /** pathname for wallet (default "batch-poster-wallet") */ - 'pathname': string; + 'pathname'?: string; /** private key for wallet */ - 'private-key': string; + 'private-key'?: string; }; /** how long to wait after no batches are ready to be posted before checking again (default 10s) */ - 'poll-interval': number; - 'redis-lock': { + 'poll-interval'?: number; + 'redis-lock'?: { /** should node always try grabing lock in background */ - 'background-lock': boolean; + 'background-lock'?: boolean; /** key for lock (default "node.batch-poster.redis-lock.simple-lock-key") */ - 'key': string; + 'key'?: string; /** how long lock is held (default 1m0s) */ - 'lockout-duration': number; + 'lockout-duration'?: number; /** this node's id prefix when acquiring the lock (optional) */ - 'my-id': string; + 'my-id'?: string; /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration': number; + 'refresh-duration'?: number; }; /** if non-empty, the Redis URL to store queued transactions in */ - 'redis-url': string; + 'redis-url'?: string; /** wait for the max batch delay, even if the batch is full */ - 'wait-for-max-delay': boolean; + 'wait-for-max-delay'?: boolean; }; - 'block-validator': { + 'block-validator'?: { /** current wasm module root ('current' read from chain, 'latest' from machines/latest dir, or provide hash) (default "current") */ - 'current-module-root': string; - 'dangerous': { + 'current-module-root'?: string; + 'dangerous'?: { /** resets block-by-block validation, starting again at genesis */ - 'reset-block-validation': boolean; + 'reset-block-validation'?: boolean; }; /** enable block-by-block validation */ - 'enable': boolean; + 'enable'?: boolean; /** failing a validation is treated as a fatal error (default true) */ - 'failure-is-fatal': boolean; + 'failure-is-fatal'?: boolean; /** prepare entries for up to that many blocks ahead of validation (small footprint) (default 1024) */ - 'forward-blocks': number; + 'forward-blocks'?: number; /** pending upgrade wasm module root to additionally validate (hash, 'latest' or empty) (default "latest") */ - 'pending-upgrade-module-root': string; + 'pending-upgrade-module-root'?: string; /** record that many blocks ahead of validation (larger footprint) (default 128) */ - 'prerecorded-blocks': number; + 'prerecorded-blocks'?: number; /** poll time to check validations (default 1s) */ - 'validation-poll': number; - 'validation-server': { + 'validation-poll'?: number; + 'validation-server'?: { /** limit size of arguments in log entries (default 2048) */ - 'arg-log-limit': number; + 'arg-log-limit'?: number; /** how long to wait for initial connection */ - 'connection-wait': number; + 'connection-wait'?: number; /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ - 'jwtsecret': string; + 'jwtsecret'?: string; /** number of retries in case of failure(0 mean one attempt) */ - 'retries': number; + 'retries'?: number; /** Errors matching this regular expression are automatically retried */ - 'retry-errors': string; + 'retry-errors'?: string; /** per-response timeout (0-disabled) */ - 'timeout': number; + 'timeout'?: number; /** url of server, use self for loopback websocket, self-auth for loopback with authentication (default "self-auth") */ - 'url': string; + 'url'?: string; }; }; - 'caching': { + 'caching'?: { /** retain past block state */ - 'archive': boolean; + 'archive'?: boolean; /** minimum age of recent blocks to keep in memory (default 30m0s) */ - 'block-age': number; + 'block-age'?: number; /** minimum number of recent blocks to keep in memory (default 128) */ - 'block-count': number; + 'block-count'?: number; /** amount of memory in megabytes to cache database contents with (default 2048) */ - 'database-cache': number; + 'database-cache'?: number; /** maximum amount of gas in blocks to skip saving state to Persistent storage (archive node only) -- warning: this option seems to cause issues */ - 'max-amount-of-gas-to-skip-state-saving': number; + 'max-amount-of-gas-to-skip-state-saving'?: number; /** maximum number of blocks to skip state saving to persistent storage (archive node only) -- warning: this option seems to cause issues */ - 'max-number-of-blocks-to-skip-state-saving': number; + 'max-number-of-blocks-to-skip-state-saving'?: number; /** amount of memory in megabytes to cache state snapshots with (default 400) */ - 'snapshot-cache': number; + 'snapshot-cache'?: number; /** maximum gas rolled back to recover snapshot (default 300000000000) */ - 'snapshot-restore-gas-limit': number; + 'snapshot-restore-gas-limit'?: number; /** amount of memory in megabytes to cache unchanged state trie nodes with (default 600) */ - 'trie-clean-cache': number; + 'trie-clean-cache'?: number; /** amount of memory in megabytes to cache state diffs against disk with (larger cache lowers database growth) (default 1024) */ - 'trie-dirty-cache': number; + 'trie-dirty-cache'?: number; /** maximum block processing time before trie is written to hard-disk (default 1h0m0s) */ - 'trie-time-limit': number; + 'trie-time-limit'?: number; }; - 'dangerous': { + 'dangerous'?: { /** DANGEROUS! disables listening to L1. To be used in test nodes only */ - 'no-l1-listener': boolean; + 'no-l1-listener'?: boolean; }; - 'data-availability': { + 'data-availability'?: { /** enable Anytrust Data Availability mode */ - 'enable': boolean; - 'ipfs-storage': { + 'enable'?: boolean; + 'ipfs-storage'?: { /** enable storage/retrieval of sequencer batch data from IPFS */ - 'enable': boolean; + 'enable'?: boolean; /** list of IPFS peers to connect to, eg /ip4/1.2.3.4/tcp/12345/p2p/abc...xyz */ - 'peers': string[]; + 'peers'?: string[]; /** pin sequencer batch data in IPFS (default true) */ - 'pin-after-get': boolean; + 'pin-after-get'?: boolean; /** percent of sequencer batch data to pin, as a floating point number in the range 0.0 to 100.0 (default 100) */ - 'pin-percentage': number; + 'pin-percentage'?: number; /** comma separated list of IPFS profiles to use, see https://docs.ipfs.tech/how-to/default-profile */ - 'profiles': string; + 'profiles'?: string; /** timeout for IPFS reads, since by default it will wait forever. Treat timeout as not found (default 1m0s) */ - 'read-timeout': number; + 'read-timeout'?: number; /** directory to use to store the local IPFS repo */ - 'repo-dir': string; + 'repo-dir'?: string; }; /** whether the Data Availability Service should fail immediately on errors (not recommended) */ - 'panic-on-error': boolean; + 'panic-on-error'?: boolean; /** layer 1 RPC connection attempts (spaced out at least 1 second per attempt, 0 to retry infinitely), only used in standalone daserver; when running as part of a node that node's L1 configuration is used (default 15) */ - 'parent-chain-connection-attempts': number; + 'parent-chain-connection-attempts'?: number; /** URL for L1 node, only used in standalone daserver; when running as part of a node that node's L1 configuration is used */ - 'parent-chain-node-url': string; + 'parent-chain-node-url'?: string; /** Data Availability Service timeout duration for Store requests (default 5s) */ - 'request-timeout': number; - 'rest-aggregator': { + 'request-timeout'?: number; + 'rest-aggregator'?: { /** enable retrieval of sequencer batch data from a list of remote REST endpoints; if other DAS storage types are enabled, this mode is used as a fallback */ - 'enable': boolean; + 'enable'?: boolean; /** number of stats entries (latency and success rate) to keep for each REST endpoint; controls whether strategy is faster or slower to respond to changing conditions (default 20) */ - 'max-per-endpoint-stats': number; + 'max-per-endpoint-stats'?: number; /** a URL to a list of URLs of REST das endpoints that is checked at startup; additive with the url option */ - 'online-url-list': string; + 'online-url-list'?: string; /** time interval to periodically fetch url list from online-url-list (default 1h0m0s) */ - 'online-url-list-fetch-interval': number; - 'simple-explore-exploit-strategy': { + 'online-url-list-fetch-interval'?: number; + 'simple-explore-exploit-strategy'?: { /** number of consecutive GetByHash calls to the aggregator where each call will cause it to select from REST endpoints in order of best latency and success rate, before switching to explore mode (default 1000) */ - 'exploit-iterations': number; + 'exploit-iterations'?: number; /** number of consecutive GetByHash calls to the aggregator where each call will cause it to randomly select from REST endpoints until one returns successfully, before switching to exploit mode (default 20) */ - 'explore-iterations': number; + 'explore-iterations'?: number; }; /** strategy to use to determine order and parallelism of calling REST endpoint URLs; valid options are 'simple-explore-exploit' (default "simple-explore-exploit") */ - 'strategy': string; + 'strategy'?: string; /** how frequently to update the strategy with endpoint latency and error rate data (default 10s) */ - 'strategy-update-interval': number; - 'sync-to-storage': { + 'strategy-update-interval'?: number; + 'sync-to-storage'?: { /** check if the data already exists in this DAS's storage. Must be disabled for fast sync with an IPFS backend (default true) */ - 'check-already-exists': boolean; + 'check-already-exists'?: boolean; /** time to wait if encountered an error before retrying (default 1s) */ - 'delay-on-error': number; + 'delay-on-error'?: number; /** eagerly sync batch data to this DAS's storage from the rest endpoints, using L1 as the index of batch data hashes; otherwise only sync lazily */ - 'eager': boolean; + 'eager'?: boolean; /** when eagerly syncing, start indexing forward from this L1 block. Only used if there is no sync state */ - 'eager-lower-bound-block': number; + 'eager-lower-bound-block'?: number; /** log only on failures to write when syncing; otherwise treat it as an error (default true) */ - 'ignore-write-errors': boolean; + 'ignore-write-errors'?: boolean; /** when eagerly syncing, max l1 blocks to read per poll (default 100) */ - 'parent-chain-blocks-per-read': number; + 'parent-chain-blocks-per-read'?: number; /** period to retain synced data (defaults to forever) (default 2562047h47m16.854775807s) */ - 'retention-period': number; + 'retention-period'?: number; /** directory to store the sync state in, ie the block number currently synced up to, so that we don't sync from scratch each time */ - 'state-dir': string; + 'state-dir'?: string; }; /** list of URLs including 'http://' or 'https://' prefixes and port numbers to REST DAS endpoints; additive with the online-url-list option */ - 'urls': string[]; + 'urls'?: string[]; /** time to wait until trying the next set of REST endpoints while waiting for a response; the next set of REST endpoints is determined by the strategy selected (default 2s) */ - 'wait-before-try-next': number; + 'wait-before-try-next'?: number; }; - 'rpc-aggregator': { + 'rpc-aggregator'?: { /** Number of assumed honest backends (H). If there are N backends, K=N+1-H valid responses are required to consider an Store request to be successful. */ - 'assumed-honest': number; + 'assumed-honest'?: number; /** JSON RPC backend configuration */ - 'backends': string; + 'backends'?: string; /** enable storage/retrieval of sequencer batch data from a list of RPC endpoints; this should only be used by the batch poster and not in combination with other DAS storage types */ - 'enable': boolean; + 'enable'?: boolean; }; /** L1 address of SequencerInbox contract */ - 'sequencer-inbox-address': string; + 'sequencer-inbox-address'?: string; }; - 'delayed-sequencer': { + 'delayed-sequencer'?: { /** enable delayed sequencer */ - 'enable': boolean; + 'enable'?: boolean; /** how many blocks in the past L1 block is considered final (ignored when using Merge finality) (default 20) */ - 'finalize-distance': number; + 'finalize-distance'?: number; /** whether to wait for full finality before sequencing delayed messages */ - 'require-full-finality': boolean; + 'require-full-finality'?: boolean; /** whether to use The Merge's notion of finality before sequencing delayed messages (default true) */ - 'use-merge-finality': boolean; + 'use-merge-finality'?: boolean; }; - 'feed': { - input: { + 'feed'?: { + input?: { /** enable per message deflate compression support (default true) */ - 'enable-compression': boolean; + 'enable-compression'?: boolean; /** initial duration to wait before reconnect (default 1s) */ - 'reconnect-initial-backoff': number; + 'reconnect-initial-backoff'?: number; /** maximum duration to wait before reconnect (default 1m4s) */ - 'reconnect-maximum-backoff': number; + 'reconnect-maximum-backoff'?: number; /** require chain id to be present on connect */ - 'require-chain-id': boolean; + 'require-chain-id'?: boolean; /** require feed version to be present on connect */ - 'require-feed-version': boolean; + 'require-feed-version'?: boolean; /** duration to wait before timing out connection to sequencer feed (default 20s) */ - 'timeout': number; + 'timeout'?: number; /** URL of sequencer feed source */ - 'url': string[]; - 'verify': { + 'url'?: string[]; + 'verify'?: { /** accept verified message from sequencer (default true) */ - 'accept-sequencer': boolean; + 'accept-sequencer'?: boolean; /** a list of allowed addresses */ - 'allowed-addresses': string[]; - 'dangerous': { + 'allowed-addresses'?: string[]; + 'dangerous'?: { /** accept empty as valid signature (default true) */ - 'accept-missing': boolean; + 'accept-missing'?: boolean; }; }; }; - output: { + output?: { /** address to bind the relay feed output to */ - 'addr': string; + 'addr'?: string; /** delay the first messages sent to each client by this amount */ - 'client-delay': number; + 'client-delay'?: number; /** duration to wait before timing out connections to client (default 15s) */ - 'client-timeout': number; - 'connection-limits': { + 'client-timeout'?: number; + 'connection-limits'?: { /** enable broadcaster per-client connection limiting */ - 'enable': boolean; + 'enable'?: boolean; /** limit clients, as identified by IPv4/v6 address, to this many connections to this relay (default 5) */ - 'per-ip-limit': number; + 'per-ip-limit'?: number; /** limit ipv6 clients, as identified by IPv6 address masked with /48, to this many connections to this relay (default 20) */ - 'per-ipv6-cidr-48-limit': number; + 'per-ipv6-cidr-48-limit'?: number; /** limit ipv6 clients, as identified by IPv6 address masked with /64, to this many connections to this relay (default 10) */ - 'per-ipv6-cidr-64-limit': number; + 'per-ipv6-cidr-64-limit'?: number; /** time to wait after a relay client disconnects before the disconnect is registered with respect to the limit for this client */ - 'reconnect-cooldown-period': number; + 'reconnect-cooldown-period'?: number; }; /** don't sign feed messages (default true) */ - 'disable-signing': boolean; + 'disable-signing'?: boolean; /** enable broadcaster */ - 'enable': boolean; + 'enable'?: boolean; /** enable per message deflate compression support (default true) */ - 'enable-compression': boolean; + 'enable-compression'?: boolean; /** duration to wait before timing out HTTP to WS upgrade (default 1s) */ - 'handshake-timeout': number; + 'handshake-timeout'?: number; /** only supply catchup buffer if requested sequence number is reasonable */ - 'limit-catchup': boolean; + 'limit-catchup'?: boolean; /** log every client connect */ - 'log-connect': boolean; + 'log-connect'?: boolean; /** log every client disconnect */ - 'log-disconnect': boolean; + 'log-disconnect'?: boolean; /** the maximum size of the catchup buffer (-1 means unlimited) (default -1) */ - 'max-catchup': number; + 'max-catchup'?: number; /** maximum number of messages allowed to accumulate before client is disconnected (default 4096) */ - 'max-send-queue': number; + 'max-send-queue'?: number; /** duration for ping interval (default 5s) */ - 'ping': number; + 'ping'?: number; /** port to bind the relay feed output to (default "9642") */ - 'port': string; + 'port'?: string; /** queue size for HTTP to WS upgrade (default 100) */ - 'queue': number; + 'queue'?: number; /** duration to wait before timing out reading data (i.e. pings) from clients (default 1s) */ - 'read-timeout': number; + 'read-timeout'?: number; /** require clients to use compression */ - 'require-compression': boolean; + 'require-compression'?: boolean; /** don't connect if client version not present */ - 'require-version': boolean; + 'require-version'?: boolean; /** sign broadcast messages */ - 'signed': boolean; + 'signed'?: boolean; /** number of threads to reserve for HTTP to WS upgrade (default 100) */ - 'workers': number; + 'workers'?: number; /** duration to wait before timing out writing data to clients (default 2s) */ - 'write-timeout': number; + 'write-timeout'?: number; }; }; - 'forwarder': { + 'forwarder'?: { /** total time to wait before cancelling connection (default 30s) */ - 'connection-timeout': number; + 'connection-timeout'?: number; /** time until idle connections are closed (default 15s) */ - 'idle-connection-timeout': number; + 'idle-connection-timeout'?: number; /** maximum number of idle connections to keep open (default 1) */ - 'max-idle-connections': number; + 'max-idle-connections'?: number; /** the Redis URL to recomend target via */ - 'redis-url': string; + 'redis-url'?: string; /** minimal time between update retries (default 100ms) */ - 'retry-interval': number; + 'retry-interval'?: number; /** forwarding target update interval (default 1s) */ - 'update-interval': number; + 'update-interval'?: number; }; /** transaction forwarding target URL, or "null" to disable forwarding (if not sequencer) */ - 'forwarding-target': string; - 'inbox-reader': { + 'forwarding-target'?: string; + 'inbox-reader'?: { /** the maximum time to wait between inbox checks (if not enough new blocks are found) (default 1m0s) */ - 'check-delay': number; + 'check-delay'?: number; /** the default number of blocks to read at once (will vary based on traffic by default) (default 100) */ - 'default-blocks-to-read': number; + 'default-blocks-to-read'?: number; /** number of latest blocks to ignore to reduce reorgs */ - 'delay-blocks': number; + 'delay-blocks'?: number; /** erase future transactions in addition to overwriting existing ones on reorg */ - 'hard-reorg': boolean; + 'hard-reorg'?: boolean; /** if adjust-blocks-to-read is enabled, the maximum number of blocks to read at once (default 2000) */ - 'max-blocks-to-read': number; + 'max-blocks-to-read'?: number; /** the minimum number of blocks to read at once (when caught up lowers load on L1) (default 1) */ - 'min-blocks-to-read': number; + 'min-blocks-to-read'?: number; /** if adjust-blocks-to-read is enabled, the target number of messages to read at once (default 500) */ - 'target-messages-read': number; + 'target-messages-read'?: number; }; - 'maintenance': { - 'lock': { + 'maintenance'?: { + 'lock'?: { /** should node always try grabing lock in background */ - 'background-lock': boolean; + 'background-lock'?: boolean; /** key for lock (default "node.maintenance.lock.simple-lock-key") */ - 'key': string; + 'key'?: string; /** how long lock is held (default 1m0s) */ - 'lockout-duration': number; + 'lockout-duration'?: number; /** this node's id prefix when acquiring the lock (optional) */ - 'my-id': string; + 'my-id'?: string; /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration': number; + 'refresh-duration'?: number; }; /** UTC 24-hour time of day to run maintenance (currently only db compaction) at (e.g. 15:00) */ - 'time-of-day': string; + 'time-of-day'?: string; }; - 'message-pruner': { + 'message-pruner'?: { /** enable message pruning (default true) */ - 'enable': boolean; + 'enable'?: boolean; /** min number of batches not pruned (default 2) */ - 'min-batches-left': number; + 'min-batches-left'?: number; /** interval for running message pruner (default 1m0s) */ - 'prune-interval': number; + 'prune-interval'?: number; }; - 'parent-chain-reader': { + 'parent-chain-reader'?: { /** enable reader connection (default true) */ - 'enable': boolean; + 'enable'?: boolean; /** warns if the latest l1 block is at least this old (default 5m0s) */ - 'old-header-timeout': number; + 'old-header-timeout'?: number; /** interval when polling endpoint (default 15s) */ - 'poll-interval': number; + 'poll-interval'?: number; /** do not attempt to subscribe to header events */ - 'poll-only': boolean; + 'poll-only'?: boolean; /** timeout when waiting for a transaction (default 5m0s) */ - 'tx-timeout': number; + 'tx-timeout'?: number; /** use l1 data about finalized/safe blocks (default true) */ - 'use-finality-data': boolean; + 'use-finality-data'?: boolean; }; - 'recording-database': { + 'recording-database'?: { /** like trie-clean-cache for the separate, recording database (used for validation) (default 16) */ - 'trie-clean-cache': number; + 'trie-clean-cache'?: number; /** like trie-dirty-cache for the separate, recording database (used for validation) (default 1024) */ - 'trie-dirty-cache': number; + 'trie-dirty-cache'?: number; }; - 'resource-mgmt': { + 'resource-mgmt'?: { /** RPC calls are throttled if free system memory excluding the page cache is below this amount, expressed in bytes or multiples of bytes with suffix B, K, M, G. The limit should be set such that sufficient free memory is left for the page cache in order for the system to be performant */ - 'mem-free-limit': string; + 'mem-free-limit'?: string; }; - 'rpc': { - 'arbdebug': { + 'rpc'?: { + 'arbdebug'?: { /** bounds the number of blocks arbdebug calls may return (default 256) */ - 'block-range-bound': number; + 'block-range-bound'?: number; /** bounds the length of timeout queues arbdebug calls may return (default 512) */ - 'timeout-queue-bound': number; + 'timeout-queue-bound'?: number; }; /** number of blocks a single bloom bit section vector holds (default 16384) */ - 'bloom-bits-blocks': number; + 'bloom-bits-blocks'?: number; /** number of confirmation blocks before a bloom section is considered final (default 256) */ - 'bloom-confirms': number; + 'bloom-confirms'?: number; /** url to redirect classic requests, use "error:[CODE:]MESSAGE" to return specified error instead of redirecting */ - 'classic-redirect': string; + 'classic-redirect'?: string; /** timeout for forwarded classic requests, where 0 = no timeout */ - 'classic-redirect-timeout': number; + 'classic-redirect-timeout'?: number; /** timeout used for eth_call (0=infinite) (default 5s) */ - 'evm-timeout': number; + 'evm-timeout'?: number; /** max number of blocks a fee history request may cover (default 1024) */ - 'feehistory-max-block-count': number; + 'feehistory-max-block-count'?: number; /** log filter system maximum number of cached blocks (default 32) */ - 'filter-log-cache-size': number; + 'filter-log-cache-size'?: number; /** log filter system maximum time filters stay active (default 5m0s) */ - 'filter-timeout': number; + 'filter-timeout'?: number; /** cap on computation gas that can be used in eth_call/estimateGas (0=infinite) (default 50000000) */ - 'gas-cap': number; + 'gas-cap'?: number; /** maximum depth for recreating state, measured in l2 gas (0=don't recreate state, -1=infinite, -2=use default value for archive or non-archive node (whichever is configured)) (default -2) */ - 'max-recreate-state-depth': number; + 'max-recreate-state-depth'?: number; /** allow transactions that aren't EIP-155 replay protected to be submitted over the RPC (default true) */ - 'tx-allow-unprotected': boolean; + 'tx-allow-unprotected'?: boolean; /** cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) */ - 'tx-fee-cap': number; + 'tx-fee-cap'?: number; }; - 'seq-coordinator': { + 'seq-coordinator'?: { /** if non-empty, launch an HTTP service binding to this address that returns status code 200 when chosen and 503 otherwise */ - 'chosen-healthcheck-addr': string; + 'chosen-healthcheck-addr'?: string; /** enable sequence coordinator */ - 'enable': boolean; + 'enable'?: boolean; /** the maximum amount of time to spend waiting for another sequencer to accept the lockout when handing it off on shutdown or db compaction (default 30s) */ - 'handoff-timeout': number; + 'handoff-timeout'?: number; /** (default 1m0s) */ - 'lockout-duration': number; + 'lockout-duration'?: number; /** (default 30s) */ - 'lockout-spare': number; + 'lockout-spare'?: number; /** will only be marked as wanting the lockout if not too far behind (default 2000) */ - 'msg-per-poll': number; + 'msg-per-poll'?: number; /** url for this sequencer if it is the chosen (default "") */ - 'my-url': string; + 'my-url'?: string; /** the Redis URL to coordinate via */ - 'redis-url': string; + 'redis-url'?: string; /** the number of times to retry releasing the wants lockout and chosen one status on shutdown (default 4) */ - 'release-retries': number; + 'release-retries'?: number; /** (default 50ms) */ - 'retry-interval': number; + 'retry-interval'?: number; /** if non-zero will add delay after transferring control (default 5s) */ - 'safe-shutdown-delay': number; + 'safe-shutdown-delay'?: number; /** (default 24h0m0s) */ - 'seq-num-duration': number; - 'signer': { - 'ecdsa': { + 'seq-num-duration'?: number; + 'signer'?: { + 'ecdsa'?: { /** accept verified message from sequencer (default true) */ - 'accept-sequencer': boolean; + 'accept-sequencer'?: boolean; /** a list of allowed addresses */ - 'allowed-addresses': string[]; - 'dangerous': { + 'allowed-addresses'?: string[]; + 'dangerous'?: { /** accept empty as valid signature (default true) */ - 'accept-missing': boolean; + 'accept-missing'?: boolean; }; }; /** if to fall back to symmetric hmac */ - 'symmetric-fallback': boolean; + 'symmetric-fallback'?: boolean; /** if to sign with symmetric hmac */ - 'symmetric-sign': boolean; - 'symmetric': { - 'dangerous': { + 'symmetric-sign'?: boolean; + 'symmetric'?: { + 'dangerous'?: { /** disable message signature verification */ - 'disable-signature-verification': boolean; + 'disable-signature-verification'?: boolean; }; /** a fallback key used for message verification */ - 'fallback-verification-key': string; + 'fallback-verification-key'?: string; /** a 32-byte (64-character) hex string used to sign messages, or a path to a file containing it */ - 'signing-key': string; + 'signing-key'?: string; }; }; /** (default 250ms) */ - 'update-interval': number; + 'update-interval'?: number; }; - 'sequencer': { - 'dangerous': { + 'sequencer'?: { + 'dangerous'?: { /** DANGEROUS! allows sequencer without coordinator. */ - 'no-coordinator': boolean; + 'no-coordinator'?: boolean; }; /** act and post to l1 as sequencer */ - 'enable': boolean; - 'forwarder': { + 'enable'?: boolean; + 'forwarder'?: { /** total time to wait before cancelling connection (default 30s) */ - 'connection-timeout': number; + 'connection-timeout'?: number; /** time until idle connections are closed (default 1m0s) */ - 'idle-connection-timeout': number; + 'idle-connection-timeout'?: number; /** maximum number of idle connections to keep open (default 100) */ - 'max-idle-connections': number; + 'max-idle-connections'?: number; /** the Redis URL to recomend target via */ - 'redis-url': string; + 'redis-url'?: string; /** minimal time between update retries (default 100ms) */ - 'retry-interval': number; + 'retry-interval'?: number; /** forwarding target update interval (default 1s) */ - 'update-interval': number; + 'update-interval'?: number; }; /** maximum acceptable time difference between the local time and the latest L1 block's timestamp (default 1h0m0s) */ - 'max-acceptable-timestamp-delta': number; + 'max-acceptable-timestamp-delta'?: number; /** minimum delay between blocks (sets a maximum speed of block production) (default 100ms) */ - 'max-block-speed': number; + 'max-block-speed'?: number; /** maximum gas executed in a revert for the sequencer to reject the transaction instead of posting it (anti-DOS) (default 31000) */ - 'max-revert-gas-reject': number; + 'max-revert-gas-reject'?: number; /** maximum transaction size the sequencer will accept (default 95000) */ - 'max-tx-data-size': number; + 'max-tx-data-size'?: number; /** size of the tx sender nonce cache (default 1024) */ - 'nonce-cache-size': number; + 'nonce-cache-size'?: number; /** maximum amount of time to wait for a predecessor before rejecting a tx with nonce too high (default 1s) */ - 'nonce-failure-cache-expiry': number; + 'nonce-failure-cache-expiry'?: number; /** number of transactions with too high of a nonce to keep in memory while waiting for their predecessor (default 1024) */ - 'nonce-failure-cache-size': number; + 'nonce-failure-cache-size'?: number; /** size of the pending tx queue (default 1024) */ - 'queue-size': number; + 'queue-size'?: number; /** maximum amount of time transaction can wait in queue (default 12s) */ - 'queue-timeout': number; + 'queue-timeout'?: number; /** comma separated whitelist of authorized senders (if empty, everyone is allowed) */ - 'sender-whitelist': string; + 'sender-whitelist'?: string; }; - 'staker': { + 'staker'?: { /** confirmation blocks (default 12) */ - 'confirmation-blocks': number; + 'confirmation-blocks'?: number; /** validator smart contract wallet public address */ - 'contract-wallet-address': string; - 'dangerous': { + 'contract-wallet-address'?: string; + 'dangerous'?: { /** DANGEROUS! make assertions even when the wasm module root is wrong */ - 'ignore-rollup-wasm-module-root': boolean; + 'ignore-rollup-wasm-module-root'?: boolean; /** DANGEROUS! allows running an L1 validator without a block validator */ - 'without-block-validator': boolean; + 'without-block-validator'?: boolean; }; - 'data-poster': { + 'data-poster'?: { /** if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance (default true) */ - 'allocate-mempool-balance': boolean; - 'dangerous': { + 'allocate-mempool-balance'?: boolean; + 'dangerous'?: { /** clear database storage */ - 'clear-dbstorage': boolean; + 'clear-dbstorage'?: boolean; }; /** encodes items in a legacy way (as it was before dropping generics) (default true) */ - 'legacy-storage-encoding': boolean; + 'legacy-storage-encoding'?: boolean; /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 10) */ - 'max-mempool-transactions': number; + 'max-mempool-transactions'?: number; /** the maximum number of unconfirmed transactions to track at once (0 = unlimited) */ - 'max-queued-transactions': number; + 'max-queued-transactions'?: number; /** the maximum tip cap to post transactions at (default 5) */ - 'max-tip-cap-gwei': number; + 'max-tip-cap-gwei'?: number; /** the minimum fee cap to post transactions at */ - 'min-fee-cap-gwei': number; + 'min-fee-cap-gwei'?: number; /** the minimum tip cap to post transactions at (default 0.05) */ - 'min-tip-cap-gwei': number; + 'min-tip-cap-gwei'?: number; /** the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee (default 1) */ - 'nonce-rbf-soft-confs': number; - 'redis-signer': { - 'dangerous': { + 'nonce-rbf-soft-confs'?: number; + 'redis-signer'?: { + 'dangerous'?: { /** disable message signature verification */ - 'disable-signature-verification': boolean; + 'disable-signature-verification'?: boolean; }; /** a fallback key used for message verification */ - 'fallback-verification-key': string; + 'fallback-verification-key'?: string; /** a 32-byte (64-character) hex string used to sign messages, or a path to a file containing it */ - 'signing-key': string; + 'signing-key'?: string; }; /** comma-separated list of durations since first posting to attempt a replace-by-fee (default "5m,10m,20m,30m,1h,2h,4h,6h,8h,12h,16h,18h,20h,22h") */ - 'replacement-times': string; + 'replacement-times'?: string; /** the target price to use for maximum fee cap calculation (default 60) */ - 'target-price-gwei': number; + 'target-price-gwei'?: number; /** the urgency to use for maximum fee cap calculation (default 2) */ - 'urgency-gwei': number; + 'urgency-gwei'?: number; /** uses database storage when enabled (default true) */ - 'use-db-storage': boolean; + 'use-db-storage'?: boolean; /** uses noop storage, it doesn't store anything */ - 'use-noop-storage': boolean; + 'use-noop-storage'?: boolean; /** only treat a transaction as confirmed after L1 finality has been achieved (recommended) (default true) */ - 'wait-for-l1-finality': boolean; + 'wait-for-l1-finality'?: boolean; }; /** disable validator challenge */ - 'disable-challenge': boolean; + 'disable-challenge'?: boolean; /** enable validator (default true) */ - 'enable': boolean; + 'enable'?: boolean; /** use this much more gas than estimation says is necessary to post transactions (default 50000) */ - 'extra-gas': number; + 'extra-gas'?: number; /** The gas refunder contract address (optional) */ - 'gas-refunder-address': string; + 'gas-refunder-address'?: string; /** if configured with the makeNodes strategy, how often to create new assertions (bypassed in case of a dispute) (default 1h0m0s) */ - 'make-assertion-interval': number; + 'make-assertion-interval'?: number; /** only create smart wallet contract and exit */ - 'only-create-wallet-contract': boolean; - 'parent-chain-wallet': { + 'only-create-wallet-contract'?: boolean; + 'parent-chain-wallet'?: { /** account to use (default is first account in keystore) */ - 'account': string; + 'account'?: string; /** if true, creates new key then exits */ - 'only-create-key': boolean; + 'only-create-key'?: boolean; /** wallet passphrase (default "PASSWORD_NOT_SET") */ - 'password': string; + 'password'?: string; /** pathname for wallet (default "validator-wallet") */ - 'pathname': string; + 'pathname'?: string; /** private key for wallet */ - 'private-key': string; + 'private-key'?: string; }; - 'posting-strategy': { + 'posting-strategy'?: { /** high gas delay blocks */ - 'high-gas-delay-blocks': number; + 'high-gas-delay-blocks'?: number; /** high gas threshold */ - 'high-gas-threshold': number; + 'high-gas-threshold'?: number; }; - 'redis-lock': { + 'redis-lock'?: { /** should node always try grabing lock in background */ - 'background-lock': boolean; + 'background-lock'?: boolean; /** key for lock (default "node.staker.redis-lock.simple-lock-key") */ - 'key': string; + 'key'?: string; /** how long lock is held (default 1m0s) */ - 'lockout-duration': number; + 'lockout-duration'?: number; /** this node's id prefix when acquiring the lock (optional) */ - 'my-id': string; + 'my-id'?: string; /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration': number; + 'refresh-duration'?: number; }; /** redis url for L1 validator */ - 'redis-url': string; + 'redis-url'?: string; /** how often the L1 validator should check the status of the L1 rollup and maybe take action with its stake (default 1m0s) */ - 'staker-interval': number; + 'staker-interval'?: number; /** assume staked nodes are valid (default true) */ - 'start-validation-from-staked': boolean; + 'start-validation-from-staked'?: boolean; /** L1 validator strategy, either watchtower, defensive, stakeLatest, or makeNodes (default "Watchtower") */ - 'strategy': string; + 'strategy'?: string; /** use a smart contract wallet instead of an EOA address */ - 'use-smart-contract-wallet': boolean; + 'use-smart-contract-wallet'?: boolean; }; - 'sync-monitor': { + 'sync-monitor'?: { /** allowed lag between messages read and blocks built (default 20) */ - 'block-build-lag': number; + 'block-build-lag'?: number; /** allowed lag between messages read from sequencer inbox and blocks built */ - 'block-build-sequencer-inbox-lag': number; + 'block-build-sequencer-inbox-lag'?: number; /** allowed lag between local and remote messages (default 15) */ - 'coordinator-msg-lag': number; + 'coordinator-msg-lag'?: number; }; - 'transaction-streamer': { + 'transaction-streamer'?: { /** delay when polling calls to execute messages (default 100ms) */ - 'execute-message-loop-delay': number; + 'execute-message-loop-delay'?: number; /** maximum cache of pending broadcaster messages (default 1024) */ - 'max-broadcaster-queue-size': number; + 'max-broadcaster-queue-size'?: number; /** maximum number of messages to attempt to resequence on reorg (0 = never resequence, -1 = always resequence) (default 1024) */ - 'max-reorg-resequence-depth': number; + 'max-reorg-resequence-depth'?: number; }; /** retain the ability to lookup transactions by hash for the past N blocks (0 = all blocks) (default 126230400) */ - 'tx-lookup-limit': number; - 'tx-pre-checker': { + 'tx-lookup-limit'?: number; + 'tx-pre-checker'?: { /** how long ago should the storage conditions from eth_SendRawTransactionConditional be true, 0 = don't check old state (default 2) */ - 'required-state-age': number; + 'required-state-age'?: number; /** maximum number of blocks to look back while looking for the seconds old state, 0 = don't limit the search (default 4) */ - 'required-state-max-blocks': number; + 'required-state-max-blocks'?: number; /** how strict to be when checking txs before forwarding them. 0 = accept anything, 10 = should never reject anything that'd succeed, 20 = likely won't reject anything that'd succeed, 30 = full validation which may reject txs that would succeed */ - 'strictness': number; + 'strictness'?: number; }; }; - 'parent-chain': { - connection: { + 'parent-chain'?: { + connection?: { /** limit size of arguments in log entries */ - 'arg-log-limit': number; + 'arg-log-limit'?: number; /** how long to wait for initial connection (default 1m0s) */ - 'connection-wait': number; + 'connection-wait'?: number; /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ - 'jwtsecret': string; + 'jwtsecret'?: string; /** number of retries in case of failure(0 mean one attempt) (default 2) */ - 'retries': number; + 'retries'?: number; /** Errors matching this regular expression are automatically retried */ - 'retry-errors': string; + 'retry-errors'?: string; /** per-response timeout (0-disabled) (default 1m0s) */ - 'timeout': number; + 'timeout'?: number; /** url of server, use self for loopback websocket, self-auth for loopback with authentication */ - 'url': string; + 'url'?: string; }; /** if set other than 0, will be used to validate database and L1 connection */ - id: number; - wallet: { + id?: number; + wallet?: { /** account to use (default is first account in keystore) */ - 'account': string; + 'account'?: string; /** if true, creates new key then exits */ - 'only-create-key': boolean; + 'only-create-key'?: boolean; /** wallet passphrase (default "PASSWORD_NOT_SET") */ - 'password': string; + 'password'?: string; /** pathname for wallet (default "wallet") */ - 'pathname': string; + 'pathname'?: string; /** private key for wallet */ - 'private-key': string; + 'private-key'?: string; }; }; - 'persistent': { + 'persistent'?: { /** directory of ancient where the chain freezer can be opened */ - 'ancient': string; + 'ancient'?: string; /** directory to store chain state */ - 'chain': string; + 'chain'?: string; /** backing database implementation to use ('leveldb' or 'pebble') (default "leveldb") */ - 'db-engine': string; + 'db-engine'?: string; /** directory to store global config (default ".arbitrum") */ - 'global-config': string; + 'global-config'?: string; /** number of file descriptor handles to use for the database (default 512) */ - 'handles': number; + 'handles'?: number; /** directory to store log file */ - 'log-dir': string; + 'log-dir'?: string; }; /** enable pprof */ - 'pprof': boolean; - 'pprof-cfg': { + 'pprof'?: boolean; + 'pprof-cfg'?: { /** pprof server address (default "127.0.0.1") */ - addr: string; + addr?: string; /** pprof server port (default 6071) */ - port: number; + port?: number; }; - 'rpc': { + 'rpc'?: { /** the maximum response size for a JSON-RPC request measured in bytes (-1 means no limit) (default 10000000) */ - 'max-batch-response-size': number; + 'max-batch-response-size'?: number; }; - 'validation': { + 'validation'?: { /** validate is an authenticated API (default true) */ - 'api-auth': boolean; + 'api-auth'?: boolean; /** validate is a public API */ - 'api-public': boolean; - 'arbitrator': { + 'api-public'?: boolean; + 'arbitrator'?: { /** timeout before discarding execution run (default 15m0s) */ - 'execution-run-timeout': number; - 'execution': { + 'execution-run-timeout'?: number; + 'execution'?: { /** how many machines to store in cache while working on a challenge (should be even) (default 4) */ - 'cached-challenge-machines': number; + 'cached-challenge-machines'?: number; /** initial steps between machines (default 100000) */ - 'initial-steps': number; + 'initial-steps'?: number; }; /** path to write machines to (default "./target/output") */ - 'output-path': string; + 'output-path'?: string; /** number of concurrent validation threads */ - 'workers': number; + 'workers'?: number; }; - 'jit': { + 'jit'?: { /** use Cranelift instead of LLVM when validating blocks using the jit-accelerated block validator (default true) */ - cranelift: boolean; + cranelift?: boolean; /** number of concurrent validation threads */ - workers: number; + workers?: number; }; /** use jit for validation (default true) */ - 'use-jit': boolean; - 'wasm': { + 'use-jit'?: boolean; + 'wasm'?: { /** path to machine folders, each containing wasm files (machine.wavm.br, replay.wasm) */ - 'root-path': string; + 'root-path'?: string; }; }; - 'ws': { + 'ws'?: { /** WS-RPC server listening interface */ - 'addr': string; + 'addr'?: string; /** APIs offered over the WS-RPC interface (default [net,web3,eth,arb]) */ - 'api': string[]; + 'api'?: string[]; /** expose private api via websocket */ - 'expose-all': boolean; + 'expose-all'?: boolean; /** Origins from which to accept websockets requests */ - 'origins': string[]; + 'origins'?: string[]; /** WS-RPC server listening port (default 8548) */ - 'port': number; + 'port'?: number; /** WS path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ - 'rpcprefix': string; + 'rpcprefix'?: string; }; }; From 401ff989b2c5b66e3253135ef15c66c427a976fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 16:47:17 +0100 Subject: [PATCH 04/20] change duration from number to string --- src/scripts/generateNodeConfigType.ts | 2 +- src/types/NodeConfig-Generated.ts | 148 +++++++++++++------------- 2 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index f40e2a4d..e1a0fcea 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -35,7 +35,7 @@ function parseCliOptions(fileContents: string): CliOption[] { uint: 'number', uint32: 'number', float: 'number', - duration: 'number', + duration: 'string', boolean: 'boolean', }; diff --git a/src/types/NodeConfig-Generated.ts b/src/types/NodeConfig-Generated.ts index 298317d6..5e6923b6 100644 --- a/src/types/NodeConfig-Generated.ts +++ b/src/types/NodeConfig-Generated.ts @@ -3,7 +3,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // // IMAGE: offchainlabs/nitro-node:v2.1.2-4c55843-dev -// TIMESTAMP: 2024-01-05T15:31:26.250Z +// TIMESTAMP: 2024-01-05T15:46:08.617Z // // --- /** Nitro node configuration options */ @@ -54,7 +54,7 @@ export type NodeConfig = { /** name of configuration file */ 'file'?: string[]; /** how often to reload configuration (0=disable periodic reloading) */ - 'reload-interval'?: number; + 'reload-interval'?: string; 's3'?: { /** S3 access key */ 'access-key'?: string; @@ -109,13 +109,13 @@ export type NodeConfig = { 'rpcprefix'?: string; 'server-timeouts'?: { /** the maximum amount of time to wait for the next request when keep-alives are enabled (http.Server.IdleTimeout) (default 2m0s) */ - 'idle-timeout'?: number; + 'idle-timeout'?: string; /** the amount of time allowed to read the request headers (http.Server.ReadHeaderTimeout) (default 30s) */ - 'read-header-timeout'?: number; + 'read-header-timeout'?: string; /** the maximum duration for reading the entire request (http.Server.ReadTimeout) (default 30s) */ - 'read-timeout'?: number; + 'read-timeout'?: string; /** the maximum duration before timing out writes of the response (http.Server.WriteTimeout) (default 30s) */ - 'write-timeout'?: number; + 'write-timeout'?: string; }; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ 'vhosts'?: string[]; @@ -132,7 +132,7 @@ export type NodeConfig = { /** path to save temp downloaded file (default "/tmp/") */ 'download-path'?: string; /** how long to wait between polling attempts (default 1m0s) */ - 'download-poll'?: number; + 'download-poll'?: string; /** init with empty state */ 'empty'?: boolean; /** if true: in case database exists init code will be reexecuted and genesis block compared to database */ @@ -166,7 +166,7 @@ export type NodeConfig = { /** metrics server port (default 6070) */ 'port'?: number; /** metrics server update interval (default 3s) */ - 'update-interval'?: number; + 'update-interval'?: string; }; 'node'?: { /** retain past block state (deprecated, please use node.caching.archive) */ @@ -175,7 +175,7 @@ export type NodeConfig = { /** batch compression level (default 11) */ 'compression-level'?: number; /** In AnyTrust mode, the period which DASes are requested to retain the stored batches. (default 360h0m0s) */ - 'das-retention-period'?: number; + 'das-retention-period'?: string; 'data-poster'?: { /** if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance (default true) */ 'allocate-mempool-balance'?: boolean; @@ -225,7 +225,7 @@ export type NodeConfig = { /** enable posting batches to l1 */ 'enable'?: boolean; /** how long to delay after error posting batch (default 10s) */ - 'error-delay'?: number; + 'error-delay'?: string; /** use this much more gas than estimation says is necessary to post batches (default 50000) */ 'extra-batch-gas'?: number; /** The gas refunder contract address (optional) */ @@ -233,9 +233,9 @@ export type NodeConfig = { /** only post messages to batches when they're within the max future block/timestamp as of this L1 block tag ("safe", "finalized", "latest", or "ignore" to ignore this check) */ 'l1-block-bound'?: string; /** post batches even if not within the layer 1 future bounds if we're within this margin of the max delay (default 1h0m0s) */ - 'l1-block-bound-bypass'?: number; + 'l1-block-bound-bypass'?: string; /** maximum batch posting delay (default 1h0m0s) */ - 'max-delay'?: number; + 'max-delay'?: string; /** maximum batch size (default 100000) */ 'max-size'?: number; 'parent-chain-wallet'?: { @@ -251,18 +251,18 @@ export type NodeConfig = { 'private-key'?: string; }; /** how long to wait after no batches are ready to be posted before checking again (default 10s) */ - 'poll-interval'?: number; + 'poll-interval'?: string; 'redis-lock'?: { /** should node always try grabing lock in background */ 'background-lock'?: boolean; /** key for lock (default "node.batch-poster.redis-lock.simple-lock-key") */ 'key'?: string; /** how long lock is held (default 1m0s) */ - 'lockout-duration'?: number; + 'lockout-duration'?: string; /** this node's id prefix when acquiring the lock (optional) */ 'my-id'?: string; /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration'?: number; + 'refresh-duration'?: string; }; /** if non-empty, the Redis URL to store queued transactions in */ 'redis-url'?: string; @@ -287,12 +287,12 @@ export type NodeConfig = { /** record that many blocks ahead of validation (larger footprint) (default 128) */ 'prerecorded-blocks'?: number; /** poll time to check validations (default 1s) */ - 'validation-poll'?: number; + 'validation-poll'?: string; 'validation-server'?: { /** limit size of arguments in log entries (default 2048) */ 'arg-log-limit'?: number; /** how long to wait for initial connection */ - 'connection-wait'?: number; + 'connection-wait'?: string; /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ 'jwtsecret'?: string; /** number of retries in case of failure(0 mean one attempt) */ @@ -300,7 +300,7 @@ export type NodeConfig = { /** Errors matching this regular expression are automatically retried */ 'retry-errors'?: string; /** per-response timeout (0-disabled) */ - 'timeout'?: number; + 'timeout'?: string; /** url of server, use self for loopback websocket, self-auth for loopback with authentication (default "self-auth") */ 'url'?: string; }; @@ -309,7 +309,7 @@ export type NodeConfig = { /** retain past block state */ 'archive'?: boolean; /** minimum age of recent blocks to keep in memory (default 30m0s) */ - 'block-age'?: number; + 'block-age'?: string; /** minimum number of recent blocks to keep in memory (default 128) */ 'block-count'?: number; /** amount of memory in megabytes to cache database contents with (default 2048) */ @@ -327,7 +327,7 @@ export type NodeConfig = { /** amount of memory in megabytes to cache state diffs against disk with (larger cache lowers database growth) (default 1024) */ 'trie-dirty-cache'?: number; /** maximum block processing time before trie is written to hard-disk (default 1h0m0s) */ - 'trie-time-limit'?: number; + 'trie-time-limit'?: string; }; 'dangerous'?: { /** DANGEROUS! disables listening to L1. To be used in test nodes only */ @@ -348,7 +348,7 @@ export type NodeConfig = { /** comma separated list of IPFS profiles to use, see https://docs.ipfs.tech/how-to/default-profile */ 'profiles'?: string; /** timeout for IPFS reads, since by default it will wait forever. Treat timeout as not found (default 1m0s) */ - 'read-timeout'?: number; + 'read-timeout'?: string; /** directory to use to store the local IPFS repo */ 'repo-dir'?: string; }; @@ -359,7 +359,7 @@ export type NodeConfig = { /** URL for L1 node, only used in standalone daserver; when running as part of a node that node's L1 configuration is used */ 'parent-chain-node-url'?: string; /** Data Availability Service timeout duration for Store requests (default 5s) */ - 'request-timeout'?: number; + 'request-timeout'?: string; 'rest-aggregator'?: { /** enable retrieval of sequencer batch data from a list of remote REST endpoints; if other DAS storage types are enabled, this mode is used as a fallback */ 'enable'?: boolean; @@ -368,7 +368,7 @@ export type NodeConfig = { /** a URL to a list of URLs of REST das endpoints that is checked at startup; additive with the url option */ 'online-url-list'?: string; /** time interval to periodically fetch url list from online-url-list (default 1h0m0s) */ - 'online-url-list-fetch-interval'?: number; + 'online-url-list-fetch-interval'?: string; 'simple-explore-exploit-strategy'?: { /** number of consecutive GetByHash calls to the aggregator where each call will cause it to select from REST endpoints in order of best latency and success rate, before switching to explore mode (default 1000) */ 'exploit-iterations'?: number; @@ -378,12 +378,12 @@ export type NodeConfig = { /** strategy to use to determine order and parallelism of calling REST endpoint URLs; valid options are 'simple-explore-exploit' (default "simple-explore-exploit") */ 'strategy'?: string; /** how frequently to update the strategy with endpoint latency and error rate data (default 10s) */ - 'strategy-update-interval'?: number; + 'strategy-update-interval'?: string; 'sync-to-storage'?: { /** check if the data already exists in this DAS's storage. Must be disabled for fast sync with an IPFS backend (default true) */ 'check-already-exists'?: boolean; /** time to wait if encountered an error before retrying (default 1s) */ - 'delay-on-error'?: number; + 'delay-on-error'?: string; /** eagerly sync batch data to this DAS's storage from the rest endpoints, using L1 as the index of batch data hashes; otherwise only sync lazily */ 'eager'?: boolean; /** when eagerly syncing, start indexing forward from this L1 block. Only used if there is no sync state */ @@ -393,14 +393,14 @@ export type NodeConfig = { /** when eagerly syncing, max l1 blocks to read per poll (default 100) */ 'parent-chain-blocks-per-read'?: number; /** period to retain synced data (defaults to forever) (default 2562047h47m16.854775807s) */ - 'retention-period'?: number; + 'retention-period'?: string; /** directory to store the sync state in, ie the block number currently synced up to, so that we don't sync from scratch each time */ 'state-dir'?: string; }; /** list of URLs including 'http://' or 'https://' prefixes and port numbers to REST DAS endpoints; additive with the online-url-list option */ 'urls'?: string[]; /** time to wait until trying the next set of REST endpoints while waiting for a response; the next set of REST endpoints is determined by the strategy selected (default 2s) */ - 'wait-before-try-next'?: number; + 'wait-before-try-next'?: string; }; 'rpc-aggregator'?: { /** Number of assumed honest backends (H). If there are N backends, K=N+1-H valid responses are required to consider an Store request to be successful. */ @@ -428,15 +428,15 @@ export type NodeConfig = { /** enable per message deflate compression support (default true) */ 'enable-compression'?: boolean; /** initial duration to wait before reconnect (default 1s) */ - 'reconnect-initial-backoff'?: number; + 'reconnect-initial-backoff'?: string; /** maximum duration to wait before reconnect (default 1m4s) */ - 'reconnect-maximum-backoff'?: number; + 'reconnect-maximum-backoff'?: string; /** require chain id to be present on connect */ 'require-chain-id'?: boolean; /** require feed version to be present on connect */ 'require-feed-version'?: boolean; /** duration to wait before timing out connection to sequencer feed (default 20s) */ - 'timeout'?: number; + 'timeout'?: string; /** URL of sequencer feed source */ 'url'?: string[]; 'verify'?: { @@ -454,9 +454,9 @@ export type NodeConfig = { /** address to bind the relay feed output to */ 'addr'?: string; /** delay the first messages sent to each client by this amount */ - 'client-delay'?: number; + 'client-delay'?: string; /** duration to wait before timing out connections to client (default 15s) */ - 'client-timeout'?: number; + 'client-timeout'?: string; 'connection-limits'?: { /** enable broadcaster per-client connection limiting */ 'enable'?: boolean; @@ -467,7 +467,7 @@ export type NodeConfig = { /** limit ipv6 clients, as identified by IPv6 address masked with /64, to this many connections to this relay (default 10) */ 'per-ipv6-cidr-64-limit'?: number; /** time to wait after a relay client disconnects before the disconnect is registered with respect to the limit for this client */ - 'reconnect-cooldown-period'?: number; + 'reconnect-cooldown-period'?: string; }; /** don't sign feed messages (default true) */ 'disable-signing'?: boolean; @@ -476,7 +476,7 @@ export type NodeConfig = { /** enable per message deflate compression support (default true) */ 'enable-compression'?: boolean; /** duration to wait before timing out HTTP to WS upgrade (default 1s) */ - 'handshake-timeout'?: number; + 'handshake-timeout'?: string; /** only supply catchup buffer if requested sequence number is reasonable */ 'limit-catchup'?: boolean; /** log every client connect */ @@ -488,13 +488,13 @@ export type NodeConfig = { /** maximum number of messages allowed to accumulate before client is disconnected (default 4096) */ 'max-send-queue'?: number; /** duration for ping interval (default 5s) */ - 'ping'?: number; + 'ping'?: string; /** port to bind the relay feed output to (default "9642") */ 'port'?: string; /** queue size for HTTP to WS upgrade (default 100) */ 'queue'?: number; /** duration to wait before timing out reading data (i.e. pings) from clients (default 1s) */ - 'read-timeout'?: number; + 'read-timeout'?: string; /** require clients to use compression */ 'require-compression'?: boolean; /** don't connect if client version not present */ @@ -504,28 +504,28 @@ export type NodeConfig = { /** number of threads to reserve for HTTP to WS upgrade (default 100) */ 'workers'?: number; /** duration to wait before timing out writing data to clients (default 2s) */ - 'write-timeout'?: number; + 'write-timeout'?: string; }; }; 'forwarder'?: { /** total time to wait before cancelling connection (default 30s) */ - 'connection-timeout'?: number; + 'connection-timeout'?: string; /** time until idle connections are closed (default 15s) */ - 'idle-connection-timeout'?: number; + 'idle-connection-timeout'?: string; /** maximum number of idle connections to keep open (default 1) */ 'max-idle-connections'?: number; /** the Redis URL to recomend target via */ 'redis-url'?: string; /** minimal time between update retries (default 100ms) */ - 'retry-interval'?: number; + 'retry-interval'?: string; /** forwarding target update interval (default 1s) */ - 'update-interval'?: number; + 'update-interval'?: string; }; /** transaction forwarding target URL, or "null" to disable forwarding (if not sequencer) */ 'forwarding-target'?: string; 'inbox-reader'?: { /** the maximum time to wait between inbox checks (if not enough new blocks are found) (default 1m0s) */ - 'check-delay'?: number; + 'check-delay'?: string; /** the default number of blocks to read at once (will vary based on traffic by default) (default 100) */ 'default-blocks-to-read'?: number; /** number of latest blocks to ignore to reduce reorgs */ @@ -546,11 +546,11 @@ export type NodeConfig = { /** key for lock (default "node.maintenance.lock.simple-lock-key") */ 'key'?: string; /** how long lock is held (default 1m0s) */ - 'lockout-duration'?: number; + 'lockout-duration'?: string; /** this node's id prefix when acquiring the lock (optional) */ 'my-id'?: string; /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration'?: number; + 'refresh-duration'?: string; }; /** UTC 24-hour time of day to run maintenance (currently only db compaction) at (e.g. 15:00) */ 'time-of-day'?: string; @@ -561,19 +561,19 @@ export type NodeConfig = { /** min number of batches not pruned (default 2) */ 'min-batches-left'?: number; /** interval for running message pruner (default 1m0s) */ - 'prune-interval'?: number; + 'prune-interval'?: string; }; 'parent-chain-reader'?: { /** enable reader connection (default true) */ 'enable'?: boolean; /** warns if the latest l1 block is at least this old (default 5m0s) */ - 'old-header-timeout'?: number; + 'old-header-timeout'?: string; /** interval when polling endpoint (default 15s) */ - 'poll-interval'?: number; + 'poll-interval'?: string; /** do not attempt to subscribe to header events */ 'poll-only'?: boolean; /** timeout when waiting for a transaction (default 5m0s) */ - 'tx-timeout'?: number; + 'tx-timeout'?: string; /** use l1 data about finalized/safe blocks (default true) */ 'use-finality-data'?: boolean; }; @@ -601,15 +601,15 @@ export type NodeConfig = { /** url to redirect classic requests, use "error:[CODE:]MESSAGE" to return specified error instead of redirecting */ 'classic-redirect'?: string; /** timeout for forwarded classic requests, where 0 = no timeout */ - 'classic-redirect-timeout'?: number; + 'classic-redirect-timeout'?: string; /** timeout used for eth_call (0=infinite) (default 5s) */ - 'evm-timeout'?: number; + 'evm-timeout'?: string; /** max number of blocks a fee history request may cover (default 1024) */ 'feehistory-max-block-count'?: number; /** log filter system maximum number of cached blocks (default 32) */ 'filter-log-cache-size'?: number; /** log filter system maximum time filters stay active (default 5m0s) */ - 'filter-timeout'?: number; + 'filter-timeout'?: string; /** cap on computation gas that can be used in eth_call/estimateGas (0=infinite) (default 50000000) */ 'gas-cap'?: number; /** maximum depth for recreating state, measured in l2 gas (0=don't recreate state, -1=infinite, -2=use default value for archive or non-archive node (whichever is configured)) (default -2) */ @@ -625,11 +625,11 @@ export type NodeConfig = { /** enable sequence coordinator */ 'enable'?: boolean; /** the maximum amount of time to spend waiting for another sequencer to accept the lockout when handing it off on shutdown or db compaction (default 30s) */ - 'handoff-timeout'?: number; + 'handoff-timeout'?: string; /** (default 1m0s) */ - 'lockout-duration'?: number; + 'lockout-duration'?: string; /** (default 30s) */ - 'lockout-spare'?: number; + 'lockout-spare'?: string; /** will only be marked as wanting the lockout if not too far behind (default 2000) */ 'msg-per-poll'?: number; /** url for this sequencer if it is the chosen (default "") */ @@ -639,11 +639,11 @@ export type NodeConfig = { /** the number of times to retry releasing the wants lockout and chosen one status on shutdown (default 4) */ 'release-retries'?: number; /** (default 50ms) */ - 'retry-interval'?: number; + 'retry-interval'?: string; /** if non-zero will add delay after transferring control (default 5s) */ - 'safe-shutdown-delay'?: number; + 'safe-shutdown-delay'?: string; /** (default 24h0m0s) */ - 'seq-num-duration'?: number; + 'seq-num-duration'?: string; 'signer'?: { 'ecdsa'?: { /** accept verified message from sequencer (default true) */ @@ -671,7 +671,7 @@ export type NodeConfig = { }; }; /** (default 250ms) */ - 'update-interval'?: number; + 'update-interval'?: string; }; 'sequencer'?: { 'dangerous'?: { @@ -682,22 +682,22 @@ export type NodeConfig = { 'enable'?: boolean; 'forwarder'?: { /** total time to wait before cancelling connection (default 30s) */ - 'connection-timeout'?: number; + 'connection-timeout'?: string; /** time until idle connections are closed (default 1m0s) */ - 'idle-connection-timeout'?: number; + 'idle-connection-timeout'?: string; /** maximum number of idle connections to keep open (default 100) */ 'max-idle-connections'?: number; /** the Redis URL to recomend target via */ 'redis-url'?: string; /** minimal time between update retries (default 100ms) */ - 'retry-interval'?: number; + 'retry-interval'?: string; /** forwarding target update interval (default 1s) */ - 'update-interval'?: number; + 'update-interval'?: string; }; /** maximum acceptable time difference between the local time and the latest L1 block's timestamp (default 1h0m0s) */ - 'max-acceptable-timestamp-delta'?: number; + 'max-acceptable-timestamp-delta'?: string; /** minimum delay between blocks (sets a maximum speed of block production) (default 100ms) */ - 'max-block-speed'?: number; + 'max-block-speed'?: string; /** maximum gas executed in a revert for the sequencer to reject the transaction instead of posting it (anti-DOS) (default 31000) */ 'max-revert-gas-reject'?: number; /** maximum transaction size the sequencer will accept (default 95000) */ @@ -705,13 +705,13 @@ export type NodeConfig = { /** size of the tx sender nonce cache (default 1024) */ 'nonce-cache-size'?: number; /** maximum amount of time to wait for a predecessor before rejecting a tx with nonce too high (default 1s) */ - 'nonce-failure-cache-expiry'?: number; + 'nonce-failure-cache-expiry'?: string; /** number of transactions with too high of a nonce to keep in memory while waiting for their predecessor (default 1024) */ 'nonce-failure-cache-size'?: number; /** size of the pending tx queue (default 1024) */ 'queue-size'?: number; /** maximum amount of time transaction can wait in queue (default 12s) */ - 'queue-timeout'?: number; + 'queue-timeout'?: string; /** comma separated whitelist of authorized senders (if empty, everyone is allowed) */ 'sender-whitelist'?: string; }; @@ -779,7 +779,7 @@ export type NodeConfig = { /** The gas refunder contract address (optional) */ 'gas-refunder-address'?: string; /** if configured with the makeNodes strategy, how often to create new assertions (bypassed in case of a dispute) (default 1h0m0s) */ - 'make-assertion-interval'?: number; + 'make-assertion-interval'?: string; /** only create smart wallet contract and exit */ 'only-create-wallet-contract'?: boolean; 'parent-chain-wallet'?: { @@ -806,16 +806,16 @@ export type NodeConfig = { /** key for lock (default "node.staker.redis-lock.simple-lock-key") */ 'key'?: string; /** how long lock is held (default 1m0s) */ - 'lockout-duration'?: number; + 'lockout-duration'?: string; /** this node's id prefix when acquiring the lock (optional) */ 'my-id'?: string; /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration'?: number; + 'refresh-duration'?: string; }; /** redis url for L1 validator */ 'redis-url'?: string; /** how often the L1 validator should check the status of the L1 rollup and maybe take action with its stake (default 1m0s) */ - 'staker-interval'?: number; + 'staker-interval'?: string; /** assume staked nodes are valid (default true) */ 'start-validation-from-staked'?: boolean; /** L1 validator strategy, either watchtower, defensive, stakeLatest, or makeNodes (default "Watchtower") */ @@ -833,7 +833,7 @@ export type NodeConfig = { }; 'transaction-streamer'?: { /** delay when polling calls to execute messages (default 100ms) */ - 'execute-message-loop-delay'?: number; + 'execute-message-loop-delay'?: string; /** maximum cache of pending broadcaster messages (default 1024) */ 'max-broadcaster-queue-size'?: number; /** maximum number of messages to attempt to resequence on reorg (0 = never resequence, -1 = always resequence) (default 1024) */ @@ -855,7 +855,7 @@ export type NodeConfig = { /** limit size of arguments in log entries */ 'arg-log-limit'?: number; /** how long to wait for initial connection (default 1m0s) */ - 'connection-wait'?: number; + 'connection-wait'?: string; /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ 'jwtsecret'?: string; /** number of retries in case of failure(0 mean one attempt) (default 2) */ @@ -863,7 +863,7 @@ export type NodeConfig = { /** Errors matching this regular expression are automatically retried */ 'retry-errors'?: string; /** per-response timeout (0-disabled) (default 1m0s) */ - 'timeout'?: number; + 'timeout'?: string; /** url of server, use self for loopback websocket, self-auth for loopback with authentication */ 'url'?: string; }; @@ -915,7 +915,7 @@ export type NodeConfig = { 'api-public'?: boolean; 'arbitrator'?: { /** timeout before discarding execution run (default 15m0s) */ - 'execution-run-timeout'?: number; + 'execution-run-timeout'?: string; 'execution'?: { /** how many machines to store in cache while working on a challenge (should be even) (default 4) */ 'cached-challenge-machines'?: number; From 15bdf090c7b862b09fbf435aa2e2f72d22703bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 16:59:56 +0100 Subject: [PATCH 05/20] clean up --- src/index.ts | 3 +- src/prepareNodeConfig.ts | 4 +- src/scripts/generateNodeConfigType.ts | 6 +-- src/types/NodeConfig-Generated.ts | 34 ++++++------- src/types/NodeConfig.ts | 70 --------------------------- 5 files changed, 24 insertions(+), 93 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6f5adbd3..d7650376 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,8 @@ import { import { ChainConfig, ChainConfigArbitrumParams } from './types/ChainConfig'; import { CoreContracts } from './types/CoreContracts'; import { ParentChain, ParentChainId } from './types/ParentChain'; -import { NodeConfig, NodeConfigChainInfoJson } from './types/NodeConfig'; +import { NodeConfig } from './types/NodeConfig-Generated'; +import { NodeConfigChainInfoJson } from './types/NodeConfig'; import { prepareNodeConfig } from './prepareNodeConfig'; import { prepareKeyset } from './prepareKeyset'; import * as utils from './utils'; diff --git a/src/prepareNodeConfig.ts b/src/prepareNodeConfig.ts index 2ec162af..9eeec0f0 100644 --- a/src/prepareNodeConfig.ts +++ b/src/prepareNodeConfig.ts @@ -1,5 +1,5 @@ +import { NodeConfig } from './types/NodeConfig-Generated'; import { - NodeConfig, NodeConfigChainInfoJson, NodeConfigDataAvailabilityRpcAggregatorBackendsJson, } from './types/NodeConfig'; @@ -124,7 +124,7 @@ export function prepareNodeConfig({ }; if (chainConfig.arbitrum.DataAvailabilityCommittee) { - config.node['data-availability'] = { + config.node!['data-availability'] = { 'enable': true, 'sequencer-inbox-address': coreContracts.sequencerInbox, 'parent-chain-node-url': parentChainRpcUrl, diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index e1a0fcea..57a16d76 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -29,14 +29,14 @@ type CliOption = { function parseCliOptions(fileContents: string): CliOption[] { const types: Record = { string: 'string', - strings: 'string[]', - stringArray: 'string[]', + strings: 'string[] | string', + stringArray: 'string[] | string', int: 'number', uint: 'number', uint32: 'number', float: 'number', - duration: 'string', boolean: 'boolean', + duration: 'string', }; // split into lines diff --git a/src/types/NodeConfig-Generated.ts b/src/types/NodeConfig-Generated.ts index 5e6923b6..33b42418 100644 --- a/src/types/NodeConfig-Generated.ts +++ b/src/types/NodeConfig-Generated.ts @@ -3,7 +3,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // // IMAGE: offchainlabs/nitro-node:v2.1.2-4c55843-dev -// TIMESTAMP: 2024-01-05T15:46:08.617Z +// TIMESTAMP: 2024-01-05T15:52:26.764Z // // --- /** Nitro node configuration options */ @@ -12,11 +12,11 @@ export type NodeConfig = { /** AUTH-RPC server listening interface (default "127.0.0.1") */ addr?: string; /** APIs offered over the AUTH-RPC interface (default [validation]) */ - api?: string[]; + api?: string[] | string; /** Path to file holding JWT secret (32B hex) */ jwtsecret?: string; /** Origins from which to accept AUTH requests (default [localhost]) */ - origins?: string[]; + origins?: string[] | string; /** AUTH-RPC server listening port (default 8549) */ port?: number; }; @@ -36,7 +36,7 @@ export type NodeConfig = { /** L2 chain ID (determines Arbitrum network) */ 'id'?: number; /** L2 chain info json files */ - 'info-files'?: string[]; + 'info-files'?: string[] | string; /** path to save temp downloaded file (default "/tmp/") */ 'info-ipfs-download-path'?: string; /** url to download chain info file */ @@ -52,7 +52,7 @@ export type NodeConfig = { /** environment variables with given prefix will be loaded as configuration values */ 'env-prefix'?: string; /** name of configuration file */ - 'file'?: string[]; + 'file'?: string[] | string; /** how often to reload configuration (0=disable periodic reloading) */ 'reload-interval'?: string; 's3'?: { @@ -90,19 +90,19 @@ export type NodeConfig = { }; 'graphql'?: { /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ - corsdomain?: string[]; + corsdomain?: string[] | string; /** Enable graphql endpoint on the rpc endpoint */ enable?: boolean; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ - vhosts?: string[]; + vhosts?: string[] | string; }; 'http'?: { /** HTTP-RPC server listening interface */ 'addr'?: string; /** APIs offered over the HTTP-RPC interface (default [net,web3,eth,arb]) */ - 'api'?: string[]; + 'api'?: string[] | string; /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ - 'corsdomain'?: string[]; + 'corsdomain'?: string[] | string; /** HTTP-RPC server listening port (default 8547) */ 'port'?: number; /** HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ @@ -118,7 +118,7 @@ export type NodeConfig = { 'write-timeout'?: string; }; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ - 'vhosts'?: string[]; + 'vhosts'?: string[] | string; }; 'init'?: { /** during init - sync database every X accounts. Lower value for low-memory systems. 0 disables. (default 100000) */ @@ -340,7 +340,7 @@ export type NodeConfig = { /** enable storage/retrieval of sequencer batch data from IPFS */ 'enable'?: boolean; /** list of IPFS peers to connect to, eg /ip4/1.2.3.4/tcp/12345/p2p/abc...xyz */ - 'peers'?: string[]; + 'peers'?: string[] | string; /** pin sequencer batch data in IPFS (default true) */ 'pin-after-get'?: boolean; /** percent of sequencer batch data to pin, as a floating point number in the range 0.0 to 100.0 (default 100) */ @@ -398,7 +398,7 @@ export type NodeConfig = { 'state-dir'?: string; }; /** list of URLs including 'http://' or 'https://' prefixes and port numbers to REST DAS endpoints; additive with the online-url-list option */ - 'urls'?: string[]; + 'urls'?: string[] | string; /** time to wait until trying the next set of REST endpoints while waiting for a response; the next set of REST endpoints is determined by the strategy selected (default 2s) */ 'wait-before-try-next'?: string; }; @@ -438,12 +438,12 @@ export type NodeConfig = { /** duration to wait before timing out connection to sequencer feed (default 20s) */ 'timeout'?: string; /** URL of sequencer feed source */ - 'url'?: string[]; + 'url'?: string[] | string; 'verify'?: { /** accept verified message from sequencer (default true) */ 'accept-sequencer'?: boolean; /** a list of allowed addresses */ - 'allowed-addresses'?: string[]; + 'allowed-addresses'?: string[] | string; 'dangerous'?: { /** accept empty as valid signature (default true) */ 'accept-missing'?: boolean; @@ -649,7 +649,7 @@ export type NodeConfig = { /** accept verified message from sequencer (default true) */ 'accept-sequencer'?: boolean; /** a list of allowed addresses */ - 'allowed-addresses'?: string[]; + 'allowed-addresses'?: string[] | string; 'dangerous'?: { /** accept empty as valid signature (default true) */ 'accept-missing'?: boolean; @@ -944,11 +944,11 @@ export type NodeConfig = { /** WS-RPC server listening interface */ 'addr'?: string; /** APIs offered over the WS-RPC interface (default [net,web3,eth,arb]) */ - 'api'?: string[]; + 'api'?: string[] | string; /** expose private api via websocket */ 'expose-all'?: boolean; /** Origins from which to accept websockets requests */ - 'origins'?: string[]; + 'origins'?: string[] | string; /** WS-RPC server listening port (default 8548) */ 'port'?: number; /** WS path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ diff --git a/src/types/NodeConfig.ts b/src/types/NodeConfig.ts index ab425b0b..ac7bcf06 100644 --- a/src/types/NodeConfig.ts +++ b/src/types/NodeConfig.ts @@ -26,73 +26,3 @@ export type NodeConfigDataAvailabilityRpcAggregatorBackendsJson = [ signermask: number; }, ]; - -export type NodeConfig = { - 'chain': { - /** - * This is a stringified `NodeConfigChainInfoJson` object. - */ - 'info-json': string; - 'name': string; - }; - 'parent-chain': { - connection: { - url: string; - }; - }; - 'http': { - addr: string; - port: number; - vhosts: string; - corsdomain: string; - api: string[]; - }; - 'node': { - 'forwarding-target': string; - 'sequencer': { - 'max-tx-data-size': number; - 'enable': boolean; - 'dangerous': { - 'no-coordinator': boolean; - }; - 'max-block-speed': string; - }; - 'delayed-sequencer': { - enable: boolean; - }; - 'batch-poster': { - 'max-size': number; - 'enable': boolean; - 'parent-chain-wallet': { - 'private-key': string; - }; - }; - 'staker': { - 'enable': boolean; - 'strategy': string; - 'parent-chain-wallet': { - 'private-key': string; - }; - }; - 'caching': { - archive: boolean; - }; - 'data-availability'?: { - 'enable': boolean; - 'sequencer-inbox-address': string; - 'parent-chain-node-url': string; - 'rest-aggregator': { - enable: boolean; - urls: string; - }; - 'rpc-aggregator': { - 'enable': boolean; - 'assumed-honest': number; - /** - * This is a stringified `NodeConfigDataAvailabilityRpcAggregatorBackendsJson` object. - */ - 'backends': string; - }; - }; - }; -}; From 0b635197bbb07149be419fca1dd0a38b992b0d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 17:01:57 +0100 Subject: [PATCH 06/20] rename file --- package.json | 2 +- src/index.ts | 2 +- src/prepareNodeConfig.ts | 2 +- src/scripts/generateNodeConfigType.ts | 2 +- src/types/{NodeConfig-Generated.ts => NodeConfig.generated.ts} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/types/{NodeConfig-Generated.ts => NodeConfig.generated.ts} (99%) diff --git a/package.json b/package.json index b04c4405..7ae7f8e5 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration", "dev": "yarn build --watch", "generate": "wagmi generate", - "generate:node-config-type": "node ./src/dist/scripts/generateNodeConfigType.js && prettier --write ./src/types/NodeConfig-Generated.ts", + "generate:node-config-type": "node ./src/dist/scripts/generateNodeConfigType.js && prettier --write ./src/types/NodeConfig.generated.ts", "test:unit": "vitest unit.test", "test:integration": "vitest integration.test", "postinstall": "patch-package", diff --git a/src/index.ts b/src/index.ts index d7650376..9e293776 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,7 @@ import { import { ChainConfig, ChainConfigArbitrumParams } from './types/ChainConfig'; import { CoreContracts } from './types/CoreContracts'; import { ParentChain, ParentChainId } from './types/ParentChain'; -import { NodeConfig } from './types/NodeConfig-Generated'; +import { NodeConfig } from './types/NodeConfig.generated'; import { NodeConfigChainInfoJson } from './types/NodeConfig'; import { prepareNodeConfig } from './prepareNodeConfig'; import { prepareKeyset } from './prepareKeyset'; diff --git a/src/prepareNodeConfig.ts b/src/prepareNodeConfig.ts index 9eeec0f0..23c276f5 100644 --- a/src/prepareNodeConfig.ts +++ b/src/prepareNodeConfig.ts @@ -1,4 +1,4 @@ -import { NodeConfig } from './types/NodeConfig-Generated'; +import { NodeConfig } from './types/NodeConfig.generated'; import { NodeConfigChainInfoJson, NodeConfigDataAvailabilityRpcAggregatorBackendsJson, diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index 57a16d76..3436d916 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -134,7 +134,7 @@ function main() { const cliOptions = parseCliOptions(content); const obj = createCliOptionsNestedObject(cliOptions); - const sourceFile = new Project().createSourceFile('./src/types/NodeConfig-Generated.ts', '', { + const sourceFile = new Project().createSourceFile('./src/types/NodeConfig.generated.ts', '', { overwrite: true, }); diff --git a/src/types/NodeConfig-Generated.ts b/src/types/NodeConfig.generated.ts similarity index 99% rename from src/types/NodeConfig-Generated.ts rename to src/types/NodeConfig.generated.ts index 33b42418..52044d4a 100644 --- a/src/types/NodeConfig-Generated.ts +++ b/src/types/NodeConfig.generated.ts @@ -3,7 +3,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // // IMAGE: offchainlabs/nitro-node:v2.1.2-4c55843-dev -// TIMESTAMP: 2024-01-05T15:52:26.764Z +// TIMESTAMP: 2024-01-05T16:01:47.230Z // // --- /** Nitro node configuration options */ From b91403731bee54690441ca12af256058f04bea98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 17:05:49 +0100 Subject: [PATCH 07/20] postscript --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ae7f8e5..d10106fe 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration", "dev": "yarn build --watch", "generate": "wagmi generate", - "generate:node-config-type": "node ./src/dist/scripts/generateNodeConfigType.js && prettier --write ./src/types/NodeConfig.generated.ts", + "generate:node-config-type": "node ./src/dist/scripts/generateNodeConfigType.js", + "postgenerate:node-config-type": "prettier --write ./src/types/NodeConfig.generated.ts", "test:unit": "vitest unit.test", "test:integration": "vitest integration.test", "postinstall": "patch-package", From d8beaad8669c23faafc58c41ab0be41db95702e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Fri, 5 Jan 2024 17:14:56 +0100 Subject: [PATCH 08/20] update nitro tag --- src/scripts/generateNodeConfigType.ts | 4 ++-- src/types/NodeConfig.generated.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index 3436d916..b6ada483 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -4,8 +4,8 @@ import { Project, Writers } from 'ts-morph'; const { objectType } = Writers; -const nitroNodeImage = 'offchainlabs/nitro-node:v2.1.2-4c55843-dev'; -const nitroNodeHelpOutputFile = 'nitro-node-help-output.txt'; +const nitroNodeImage = `offchainlabs/nitro-node:v2.1.3-e815395`; +const nitroNodeHelpOutputFile = `${nitroNodeImage.replace('/', '-')}-help.txt`; function generateHeader() { return [ diff --git a/src/types/NodeConfig.generated.ts b/src/types/NodeConfig.generated.ts index 52044d4a..66c8e455 100644 --- a/src/types/NodeConfig.generated.ts +++ b/src/types/NodeConfig.generated.ts @@ -2,8 +2,8 @@ // // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // -// IMAGE: offchainlabs/nitro-node:v2.1.2-4c55843-dev -// TIMESTAMP: 2024-01-05T16:01:47.230Z +// IMAGE: offchainlabs/nitro-node:v2.1.3-e815395 +// TIMESTAMP: 2024-01-05T16:14:51.020Z // // --- /** Nitro node configuration options */ From 2fd361f8fce514277de01bd1dd99501b61897129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Mon, 8 Jan 2024 10:55:17 +0100 Subject: [PATCH 09/20] allow specifying tag through args --- src/scripts/generateNodeConfigType.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index b6ada483..88bbc42e 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -4,9 +4,24 @@ import { Project, Writers } from 'ts-morph'; const { objectType } = Writers; -const nitroNodeImage = `offchainlabs/nitro-node:v2.1.3-e815395`; +function getNitroNodeImageTag(): string { + const argv = process.argv.slice(2); + + if (argv.length < 2 || argv[0] !== '--nitro-node-tag') { + throw new Error( + `You must specify the nitro node image tag, e.g. "--nitro-node-tag v2.1.3-e815395"`, + ); + } + + return argv[1]; +} + +const nitroNodeTag = getNitroNodeImageTag(); +const nitroNodeImage = `offchainlabs/nitro-node:${nitroNodeTag}`; const nitroNodeHelpOutputFile = `${nitroNodeImage.replace('/', '-')}-help.txt`; +console.log(`Using image ${nitroNodeImage}`); + function generateHeader() { return [ `// ---`, From cc1596a0c106ca31f4eb68c21501798e890f5fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Tue, 9 Jan 2024 17:59:39 +0100 Subject: [PATCH 10/20] fix type mapping --- src/prepareNodeConfig.ts | 6 ++--- src/scripts/generateNodeConfigType.ts | 4 ++-- src/types/NodeConfig.generated.ts | 34 +++++++++++++-------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/prepareNodeConfig.ts b/src/prepareNodeConfig.ts index 23c276f5..176e6c7b 100644 --- a/src/prepareNodeConfig.ts +++ b/src/prepareNodeConfig.ts @@ -86,8 +86,8 @@ export function prepareNodeConfig({ 'http': { addr: '0.0.0.0', port: 8449, - vhosts: '*', - corsdomain: '*', + vhosts: ['*'], + corsdomain: ['*'], api: ['eth', 'net', 'web3', 'arb', 'debug'], }, 'node': { @@ -130,7 +130,7 @@ export function prepareNodeConfig({ 'parent-chain-node-url': parentChainRpcUrl, 'rest-aggregator': { enable: true, - urls: 'http://localhost:9876', + urls: ['http://localhost:9876'], }, 'rpc-aggregator': { 'enable': true, diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index 88bbc42e..daa09076 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -44,8 +44,8 @@ type CliOption = { function parseCliOptions(fileContents: string): CliOption[] { const types: Record = { string: 'string', - strings: 'string[] | string', - stringArray: 'string[] | string', + strings: 'string[]', + stringArray: 'string[]', int: 'number', uint: 'number', uint32: 'number', diff --git a/src/types/NodeConfig.generated.ts b/src/types/NodeConfig.generated.ts index 66c8e455..4128127d 100644 --- a/src/types/NodeConfig.generated.ts +++ b/src/types/NodeConfig.generated.ts @@ -3,7 +3,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // // IMAGE: offchainlabs/nitro-node:v2.1.3-e815395 -// TIMESTAMP: 2024-01-05T16:14:51.020Z +// TIMESTAMP: 2024-01-09T16:59:21.225Z // // --- /** Nitro node configuration options */ @@ -12,11 +12,11 @@ export type NodeConfig = { /** AUTH-RPC server listening interface (default "127.0.0.1") */ addr?: string; /** APIs offered over the AUTH-RPC interface (default [validation]) */ - api?: string[] | string; + api?: string[]; /** Path to file holding JWT secret (32B hex) */ jwtsecret?: string; /** Origins from which to accept AUTH requests (default [localhost]) */ - origins?: string[] | string; + origins?: string[]; /** AUTH-RPC server listening port (default 8549) */ port?: number; }; @@ -36,7 +36,7 @@ export type NodeConfig = { /** L2 chain ID (determines Arbitrum network) */ 'id'?: number; /** L2 chain info json files */ - 'info-files'?: string[] | string; + 'info-files'?: string[]; /** path to save temp downloaded file (default "/tmp/") */ 'info-ipfs-download-path'?: string; /** url to download chain info file */ @@ -52,7 +52,7 @@ export type NodeConfig = { /** environment variables with given prefix will be loaded as configuration values */ 'env-prefix'?: string; /** name of configuration file */ - 'file'?: string[] | string; + 'file'?: string[]; /** how often to reload configuration (0=disable periodic reloading) */ 'reload-interval'?: string; 's3'?: { @@ -90,19 +90,19 @@ export type NodeConfig = { }; 'graphql'?: { /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ - corsdomain?: string[] | string; + corsdomain?: string[]; /** Enable graphql endpoint on the rpc endpoint */ enable?: boolean; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ - vhosts?: string[] | string; + vhosts?: string[]; }; 'http'?: { /** HTTP-RPC server listening interface */ 'addr'?: string; /** APIs offered over the HTTP-RPC interface (default [net,web3,eth,arb]) */ - 'api'?: string[] | string; + 'api'?: string[]; /** Comma separated list of domains from which to accept cross origin requests (browser enforced) */ - 'corsdomain'?: string[] | string; + 'corsdomain'?: string[]; /** HTTP-RPC server listening port (default 8547) */ 'port'?: number; /** HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ @@ -118,7 +118,7 @@ export type NodeConfig = { 'write-timeout'?: string; }; /** Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard (default [localhost]) */ - 'vhosts'?: string[] | string; + 'vhosts'?: string[]; }; 'init'?: { /** during init - sync database every X accounts. Lower value for low-memory systems. 0 disables. (default 100000) */ @@ -340,7 +340,7 @@ export type NodeConfig = { /** enable storage/retrieval of sequencer batch data from IPFS */ 'enable'?: boolean; /** list of IPFS peers to connect to, eg /ip4/1.2.3.4/tcp/12345/p2p/abc...xyz */ - 'peers'?: string[] | string; + 'peers'?: string[]; /** pin sequencer batch data in IPFS (default true) */ 'pin-after-get'?: boolean; /** percent of sequencer batch data to pin, as a floating point number in the range 0.0 to 100.0 (default 100) */ @@ -398,7 +398,7 @@ export type NodeConfig = { 'state-dir'?: string; }; /** list of URLs including 'http://' or 'https://' prefixes and port numbers to REST DAS endpoints; additive with the online-url-list option */ - 'urls'?: string[] | string; + 'urls'?: string[]; /** time to wait until trying the next set of REST endpoints while waiting for a response; the next set of REST endpoints is determined by the strategy selected (default 2s) */ 'wait-before-try-next'?: string; }; @@ -438,12 +438,12 @@ export type NodeConfig = { /** duration to wait before timing out connection to sequencer feed (default 20s) */ 'timeout'?: string; /** URL of sequencer feed source */ - 'url'?: string[] | string; + 'url'?: string[]; 'verify'?: { /** accept verified message from sequencer (default true) */ 'accept-sequencer'?: boolean; /** a list of allowed addresses */ - 'allowed-addresses'?: string[] | string; + 'allowed-addresses'?: string[]; 'dangerous'?: { /** accept empty as valid signature (default true) */ 'accept-missing'?: boolean; @@ -649,7 +649,7 @@ export type NodeConfig = { /** accept verified message from sequencer (default true) */ 'accept-sequencer'?: boolean; /** a list of allowed addresses */ - 'allowed-addresses'?: string[] | string; + 'allowed-addresses'?: string[]; 'dangerous'?: { /** accept empty as valid signature (default true) */ 'accept-missing'?: boolean; @@ -944,11 +944,11 @@ export type NodeConfig = { /** WS-RPC server listening interface */ 'addr'?: string; /** APIs offered over the WS-RPC interface (default [net,web3,eth,arb]) */ - 'api'?: string[] | string; + 'api'?: string[]; /** expose private api via websocket */ 'expose-all'?: boolean; /** Origins from which to accept websockets requests */ - 'origins'?: string[] | string; + 'origins'?: string[]; /** WS-RPC server listening port (default 8548) */ 'port'?: number; /** WS path path prefix on which JSON-RPC is served. Use '/' to serve on all paths */ From def8febe3c52a8bbee6a00efa2ece25991b4b916 Mon Sep 17 00:00:00 2001 From: spsjvc Date: Thu, 8 Feb 2024 21:02:00 +0100 Subject: [PATCH 11/20] build --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d10106fe..62c4aa9b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration", "dev": "yarn build --watch", "generate": "wagmi generate", - "generate:node-config-type": "node ./src/dist/scripts/generateNodeConfigType.js", + "generate:node-config-type": "yarn build && node ./src/dist/scripts/generateNodeConfigType.js", "postgenerate:node-config-type": "prettier --write ./src/types/NodeConfig.generated.ts", "test:unit": "vitest unit.test", "test:integration": "vitest integration.test", From 3b75358703aeb42c8bc809b8337ce812e3c125a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Thu, 22 Feb 2024 14:59:00 +0100 Subject: [PATCH 12/20] fix --- src/scripts/generateNodeConfigType.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index daa09076..a1eada76 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -58,8 +58,10 @@ function parseCliOptions(fileContents: string): CliOption[] { let lines = fileContents.split('\n'); // trim whitespaces lines = lines.map((line) => line.trim()); - // only leave lines that start with "--", i.e. the flag - lines = lines.filter((line) => line.startsWith('--')); + // only leave lines that start with "--", e.g. "--auth.addr string" but exclude "--help" and "--dev" + lines = lines.filter( + (line) => line.startsWith('--') && !line.includes('--help') && !line.includes('--dev'), + ); // sanitize the boolean types lines = lines.map((line) => { let split = line.split(' '); From 9afe587b9fb861f8672966c0d4496e900a4efdca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Thu, 22 Feb 2024 15:01:09 +0100 Subject: [PATCH 13/20] fix multi-line comments --- src/scripts/generateNodeConfigType.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index a1eada76..ab5833ce 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -58,7 +58,18 @@ function parseCliOptions(fileContents: string): CliOption[] { let lines = fileContents.split('\n'); // trim whitespaces lines = lines.map((line) => line.trim()); + // special case for flags with comments that span multiple lines + // todo: generalize this so it automatically detects and merges multi-line comments?? + lines = lines.map((line, lineIndex) => { + // this comment spans 3 lines + if (line.includes('max-fee-cap-formula')) { + return `${line} ${lines[lineIndex + 1]} ${lines[lineIndex + 2]}`; + } + + return line; + }); // only leave lines that start with "--", e.g. "--auth.addr string" but exclude "--help" and "--dev" + lines = lines.filter( (line) => line.startsWith('--') && !line.includes('--help') && !line.includes('--dev'), ); From 20f3bac1a10b9e3d86bdeeefb17327d1531ff61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Thu, 22 Feb 2024 15:01:42 +0100 Subject: [PATCH 14/20] use v2.2.5 generated --- src/types/NodeConfig.generated.ts | 478 +++++++++++++++++++----------- 1 file changed, 309 insertions(+), 169 deletions(-) diff --git a/src/types/NodeConfig.generated.ts b/src/types/NodeConfig.generated.ts index 4128127d..d87fa856 100644 --- a/src/types/NodeConfig.generated.ts +++ b/src/types/NodeConfig.generated.ts @@ -2,8 +2,8 @@ // // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // -// IMAGE: offchainlabs/nitro-node:v2.1.3-e815395 -// TIMESTAMP: 2024-01-09T16:59:21.225Z +// IMAGE: offchainlabs/nitro-node:v2.2.5-a20a1c7 +// TIMESTAMP: 2024-02-22T14:01:14.918Z // // --- /** Nitro node configuration options */ @@ -20,6 +20,20 @@ export type NodeConfig = { /** AUTH-RPC server listening port (default 8549) */ port?: number; }; + 'blocks-reexecutor'?: { + /** minimum number of blocks to execute per thread. When mode is random this acts as the size of random block range sample (default 10000) */ + 'blocks-per-thread'?: number; + /** enables re-execution of a range of blocks against historic state */ + 'enable'?: boolean; + /** last block number of the block range for re-execution */ + 'end-block'?: number; + /** mode to run the blocks-reexecutor on. Valid modes full and random. full - execute all the blocks in the given range. random - execute a random sample range of blocks with in a given range (default "random") */ + 'mode'?: string; + /** number of threads to parallelize blocks re-execution (default 10) */ + 'room'?: number; + /** first block number of the block range for re-execution */ + 'start-block'?: number; + }; 'chain'?: { 'dev-wallet'?: { /** account to use (default is first account in keystore) */ @@ -70,6 +84,164 @@ export type NodeConfig = { /** configuration as JSON string */ 'string'?: string; }; + 'execution'?: { + 'caching'?: { + /** retain past block state */ + 'archive'?: boolean; + /** minimum age of recent blocks to keep in memory (default 30m0s) */ + 'block-age'?: string; + /** minimum number of recent blocks to keep in memory (default 128) */ + 'block-count'?: number; + /** amount of memory in megabytes to cache database contents with (default 2048) */ + 'database-cache'?: number; + /** maximum amount of gas in blocks to skip saving state to Persistent storage (archive node only) -- warning: this option seems to cause issues */ + 'max-amount-of-gas-to-skip-state-saving'?: number; + /** maximum number of blocks to skip state saving to persistent storage (archive node only) -- warning: this option seems to cause issues */ + 'max-number-of-blocks-to-skip-state-saving'?: number; + /** amount of memory in megabytes to cache state snapshots with (default 400) */ + 'snapshot-cache'?: number; + /** maximum gas rolled back to recover snapshot (default 300000000000) */ + 'snapshot-restore-gas-limit'?: number; + /** amount of memory in megabytes to cache unchanged state trie nodes with (default 600) */ + 'trie-clean-cache'?: number; + /** amount of memory in megabytes to cache state diffs against disk with (larger cache lowers database growth) (default 1024) */ + 'trie-dirty-cache'?: number; + /** maximum block processing time before trie is written to hard-disk (default 1h0m0s) */ + 'trie-time-limit'?: string; + }; + 'dangerous'?: { + /** DANGEROUS! forces a reorg to an old block height. To be used for testing only. -1 to disable (default -1) */ + 'reorg-to-block'?: number; + }; + /** enable prefetching of blocks (default true) */ + 'enable-prefetch-block'?: boolean; + 'forwarder'?: { + /** total time to wait before cancelling connection (default 30s) */ + 'connection-timeout'?: string; + /** time until idle connections are closed (default 15s) */ + 'idle-connection-timeout'?: string; + /** maximum number of idle connections to keep open (default 1) */ + 'max-idle-connections'?: number; + /** the Redis URL to recomend target via */ + 'redis-url'?: string; + /** minimal time between update retries (default 100ms) */ + 'retry-interval'?: string; + /** forwarding target update interval (default 1s) */ + 'update-interval'?: string; + }; + /** transaction forwarding target URL, or "null" to disable forwarding (iff not sequencer) */ + 'forwarding-target'?: string; + 'parent-chain-reader'?: { + 'dangerous'?: { + /** Dangerous! only meant to be used by system tests */ + 'wait-for-tx-approval-safe-poll'?: string; + }; + /** enable reader connection (default true) */ + 'enable'?: boolean; + /** warns if the latest l1 block is at least this old (default 5m0s) */ + 'old-header-timeout'?: string; + /** interval when polling endpoint (default 15s) */ + 'poll-interval'?: string; + /** do not attempt to subscribe to header events */ + 'poll-only'?: boolean; + /** interval for subscribe error (default 5m0s) */ + 'subscribe-err-interval'?: string; + /** timeout when waiting for a transaction (default 5m0s) */ + 'tx-timeout'?: string; + /** use l1 data about finalized/safe blocks (default true) */ + 'use-finality-data'?: boolean; + }; + 'recording-database'?: { + /** like trie-clean-cache for the separate, recording database (used for validation) (default 16) */ + 'trie-clean-cache'?: number; + /** like trie-dirty-cache for the separate, recording database (used for validation) (default 1024) */ + 'trie-dirty-cache'?: number; + }; + 'rpc'?: { + /** list of whitelisted rpc methods */ + 'allow-method'?: string[]; + 'arbdebug'?: { + /** bounds the number of blocks arbdebug calls may return (default 256) */ + 'block-range-bound'?: number; + /** bounds the length of timeout queues arbdebug calls may return (default 512) */ + 'timeout-queue-bound'?: number; + }; + /** number of blocks a single bloom bit section vector holds (default 16384) */ + 'bloom-bits-blocks'?: number; + /** number of confirmation blocks before a bloom section is considered final (default 256) */ + 'bloom-confirms'?: number; + /** url to redirect classic requests, use "error:[CODE:]MESSAGE" to return specified error instead of redirecting */ + 'classic-redirect'?: string; + /** timeout for forwarded classic requests, where 0 = no timeout */ + 'classic-redirect-timeout'?: string; + /** timeout used for eth_call (0=infinite) (default 5s) */ + 'evm-timeout'?: string; + /** max number of blocks a fee history request may cover (default 1024) */ + 'feehistory-max-block-count'?: number; + /** log filter system maximum number of cached blocks (default 32) */ + 'filter-log-cache-size'?: number; + /** log filter system maximum time filters stay active (default 5m0s) */ + 'filter-timeout'?: string; + /** cap on computation gas that can be used in eth_call/estimateGas (0=infinite) (default 50000000) */ + 'gas-cap'?: number; + /** maximum depth for recreating state, measured in l2 gas (0=don't recreate state, -1=infinite, -2=use default value for archive or non-archive node (whichever is configured)) (default -2) */ + 'max-recreate-state-depth'?: number; + /** allow transactions that aren't EIP-155 replay protected to be submitted over the RPC (default true) */ + 'tx-allow-unprotected'?: boolean; + /** cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) */ + 'tx-fee-cap'?: number; + }; + /** secondary transaction forwarding target URL */ + 'secondary-forwarding-target'?: string[]; + 'sequencer'?: { + /** act and post to l1 as sequencer */ + 'enable'?: boolean; + 'forwarder'?: { + /** total time to wait before cancelling connection (default 30s) */ + 'connection-timeout'?: string; + /** time until idle connections are closed (default 1m0s) */ + 'idle-connection-timeout'?: string; + /** maximum number of idle connections to keep open (default 100) */ + 'max-idle-connections'?: number; + /** the Redis URL to recomend target via */ + 'redis-url'?: string; + /** minimal time between update retries (default 100ms) */ + 'retry-interval'?: string; + /** forwarding target update interval (default 1s) */ + 'update-interval'?: string; + }; + /** maximum acceptable time difference between the local time and the latest L1 block's timestamp (default 1h0m0s) */ + 'max-acceptable-timestamp-delta'?: string; + /** minimum delay between blocks (sets a maximum speed of block production) (default 250ms) */ + 'max-block-speed'?: string; + /** maximum gas executed in a revert for the sequencer to reject the transaction instead of posting it (anti-DOS) (default 31000) */ + 'max-revert-gas-reject'?: number; + /** maximum transaction size the sequencer will accept (default 95000) */ + 'max-tx-data-size'?: number; + /** size of the tx sender nonce cache (default 1024) */ + 'nonce-cache-size'?: number; + /** maximum amount of time to wait for a predecessor before rejecting a tx with nonce too high (default 1s) */ + 'nonce-failure-cache-expiry'?: string; + /** number of transactions with too high of a nonce to keep in memory while waiting for their predecessor (default 1024) */ + 'nonce-failure-cache-size'?: number; + /** size of the pending tx queue (default 1024) */ + 'queue-size'?: number; + /** maximum amount of time transaction can wait in queue (default 12s) */ + 'queue-timeout'?: string; + /** comma separated whitelist of authorized senders (if empty, everyone is allowed) */ + 'sender-whitelist'?: string; + }; + /** retain the ability to lookup transactions by hash for the past N blocks (0 = all blocks) (default 126230400) */ + 'tx-lookup-limit'?: number; + 'tx-pre-checker'?: { + /** how long ago should the storage conditions from eth_SendRawTransactionConditional be true, 0 = don't check old state (default 2) */ + 'required-state-age'?: number; + /** maximum number of blocks to look back while looking for the seconds old state, 0 = don't limit the search (default 4) */ + 'required-state-max-blocks'?: number; + /** how strict to be when checking txs before forwarding them. 0 = accept anything, 10 = should never reject anything that'd succeed, 20 = likely won't reject anything that'd succeed, 30 = full validation which may reject txs that would succeed */ + 'strictness'?: number; + }; + }; 'file-logging'?: { /** size of intermediate log records buffer (default 512) */ 'buf-size'?: number; @@ -143,6 +315,8 @@ export type NodeConfig = { 'prune'?: string; /** the amount of memory in megabytes to use for the pruning bloom filter (higher values prune better) (default 2048) */ 'prune-bloom-size'?: number; + /** block number to start recreating missing states from (0 = disabled) */ + 'recreate-missing-state-from'?: number; /** forces a reset to an old message height. Also set max-reorg-resequence-depth=0 to force re-reading messages (default -1) */ 'reset-to-message'?: number; /** quit after init is done */ @@ -169,8 +343,6 @@ export type NodeConfig = { 'update-interval'?: string; }; 'node'?: { - /** retain past block state (deprecated, please use node.caching.archive) */ - 'archive'?: boolean; 'batch-poster'?: { /** batch compression level (default 11) */ 'compression-level'?: number; @@ -183,9 +355,29 @@ export type NodeConfig = { /** clear database storage */ 'clear-dbstorage'?: boolean; }; - /** encodes items in a legacy way (as it was before dropping generics) (default true) */ + /** unit to measure the time elapsed since creation of transaction used for maximum fee cap calculation (default 10m0s) */ + 'elapsed-time-base'?: string; + /** weight given to the units of time elapsed used for maximum fee cap calculation (default 10) */ + 'elapsed-time-importance'?: number; + 'external-signer'?: { + /** external signer address */ + 'address'?: string; + /** rpc client cert */ + 'client-cert'?: string; + /** rpc client private key */ + 'client-private-key'?: string; + /** external signer method (default "eth_signTransaction") */ + 'method'?: string; + /** external signer root CA */ + 'root-ca'?: string; + /** external signer url */ + 'url'?: string; + }; + /** encodes items in a legacy way (as it was before dropping generics) */ 'legacy-storage-encoding'?: boolean; - /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 10) */ + /** mathematical formula to calculate maximum fee cap gwei the result of which would be float64. This expression is expected to be evaluated please refer https://github.com/Knetic/govaluate/blob/master/MANUAL.md to find all available mathematical operators. Currently available variables to construct the formula are BacklogOfBatches, UrgencyGWei, ElapsedTime, ElapsedTimeBase, ElapsedTimeImportance, and TargetPriceGWei (default "((BacklogOfBatches * UrgencyGWei) ** 2) + ((ElapsedTime/ElapsedTimeBase) ** 2) * ElapsedTimeImportance + TargetPriceGWei") */ + 'max-fee-cap-formula'?: string; + /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 20) */ 'max-mempool-transactions'?: number; /** the maximum number of unconfirmed transactions to track at once (0 = unlimited) */ 'max-queued-transactions'?: number; @@ -230,10 +422,14 @@ export type NodeConfig = { 'extra-batch-gas'?: number; /** The gas refunder contract address (optional) */ 'gas-refunder-address'?: string; + /** if the parent chain supports 4844 blobs and ignore-blob-price is true, post 4844 blobs even if it's not price efficient */ + 'ignore-blob-price'?: boolean; /** only post messages to batches when they're within the max future block/timestamp as of this L1 block tag ("safe", "finalized", "latest", or "ignore" to ignore this check) */ 'l1-block-bound'?: string; /** post batches even if not within the layer 1 future bounds if we're within this margin of the max delay (default 1h0m0s) */ 'l1-block-bound-bypass'?: string; + /** maximum 4844 blob enabled batch size (default 779288) */ + 'max-4844-batch-size'?: number; /** maximum batch posting delay (default 1h0m0s) */ 'max-delay'?: string; /** maximum batch size (default 100000) */ @@ -252,10 +448,14 @@ export type NodeConfig = { }; /** how long to wait after no batches are ready to be posted before checking again (default 10s) */ 'poll-interval'?: string; + /** if the parent chain supports 4844 blobs and they're well priced, post EIP-4844 blobs */ + 'post-4844-blobs'?: boolean; 'redis-lock'?: { /** should node always try grabing lock in background */ 'background-lock'?: boolean; - /** key for lock (default "node.batch-poster.redis-lock.simple-lock-key") */ + /** if false, always treat this as locked and don't write the lock to redis (default true) */ + 'enable'?: boolean; + /** key for lock */ 'key'?: string; /** how long lock is held (default 1m0s) */ 'lockout-duration'?: string; @@ -266,9 +466,17 @@ export type NodeConfig = { }; /** if non-empty, the Redis URL to store queued transactions in */ 'redis-url'?: string; + /** post batches with access lists to reduce gas usage (disabled for L3s) (default true) */ + 'use-access-lists'?: boolean; /** wait for the max batch delay, even if the batch is full */ 'wait-for-max-delay'?: boolean; }; + 'blob-client'?: { + /** Beacon Chain url to use for fetching blobs */ + 'beacon-chain-url'?: string; + /** Full path of the directory to save fetched blobs */ + 'blob-directory'?: string; + }; 'block-validator'?: { /** current wasm module root ('current' read from chain, 'latest' from machines/latest dir, or provide hash) (default "current") */ 'current-module-root'?: string; @@ -282,12 +490,16 @@ export type NodeConfig = { 'failure-is-fatal'?: boolean; /** prepare entries for up to that many blocks ahead of validation (small footprint) (default 1024) */ 'forward-blocks'?: number; + /** minimum free-memory limit after reaching which the blockvalidator pauses validation. Enabled by default as 1GB, to disable provide empty string (default "default") */ + 'memory-free-limit'?: string; /** pending upgrade wasm module root to additionally validate (hash, 'latest' or empty) (default "latest") */ 'pending-upgrade-module-root'?: string; - /** record that many blocks ahead of validation (larger footprint) (default 128) */ + /** record that many blocks ahead of validation (larger footprint) (default 20) */ 'prerecorded-blocks'?: number; /** poll time to check validations (default 1s) */ 'validation-poll'?: string; + /** array of validation rpc configs given as a json string. time duration should be supplied in number indicating nanoseconds (default "default") */ + 'validation-server-configs-list'?: string; 'validation-server'?: { /** limit size of arguments in log entries (default 2048) */ 'arg-log-limit'?: number; @@ -295,9 +507,11 @@ export type NodeConfig = { 'connection-wait'?: string; /** path to file with jwtsecret for validation - ignored if url is self or self-auth */ 'jwtsecret'?: string; - /** number of retries in case of failure(0 mean one attempt) */ + /** number of retries in case of failure(0 mean one attempt) (default 3) */ 'retries'?: number; - /** Errors matching this regular expression are automatically retried */ + /** delay between retries */ + 'retry-delay'?: string; + /** Errors matching this regular expression are automatically retried (default "websocket: close.*|dial tcp .*|.*i/o timeout|.*connection reset by peer|.*connection refused") */ 'retry-errors'?: string; /** per-response timeout (0-disabled) */ 'timeout'?: string; @@ -305,33 +519,11 @@ export type NodeConfig = { 'url'?: string; }; }; - 'caching'?: { - /** retain past block state */ - 'archive'?: boolean; - /** minimum age of recent blocks to keep in memory (default 30m0s) */ - 'block-age'?: string; - /** minimum number of recent blocks to keep in memory (default 128) */ - 'block-count'?: number; - /** amount of memory in megabytes to cache database contents with (default 2048) */ - 'database-cache'?: number; - /** maximum amount of gas in blocks to skip saving state to Persistent storage (archive node only) -- warning: this option seems to cause issues */ - 'max-amount-of-gas-to-skip-state-saving'?: number; - /** maximum number of blocks to skip state saving to persistent storage (archive node only) -- warning: this option seems to cause issues */ - 'max-number-of-blocks-to-skip-state-saving'?: number; - /** amount of memory in megabytes to cache state snapshots with (default 400) */ - 'snapshot-cache'?: number; - /** maximum gas rolled back to recover snapshot (default 300000000000) */ - 'snapshot-restore-gas-limit'?: number; - /** amount of memory in megabytes to cache unchanged state trie nodes with (default 600) */ - 'trie-clean-cache'?: number; - /** amount of memory in megabytes to cache state diffs against disk with (larger cache lowers database growth) (default 1024) */ - 'trie-dirty-cache'?: number; - /** maximum block processing time before trie is written to hard-disk (default 1h0m0s) */ - 'trie-time-limit'?: string; - }; 'dangerous'?: { /** DANGEROUS! disables listening to L1. To be used in test nodes only */ 'no-l1-listener'?: boolean; + /** DANGEROUS! allows sequencing without sequencer-coordinator */ + 'no-sequencer-coordinator'?: boolean; }; 'data-availability'?: { /** enable Anytrust Data Availability mode */ @@ -354,9 +546,9 @@ export type NodeConfig = { }; /** whether the Data Availability Service should fail immediately on errors (not recommended) */ 'panic-on-error'?: boolean; - /** layer 1 RPC connection attempts (spaced out at least 1 second per attempt, 0 to retry infinitely), only used in standalone daserver; when running as part of a node that node's L1 configuration is used (default 15) */ + /** parent chain RPC connection attempts (spaced out at least 1 second per attempt, 0 to retry infinitely), only used in standalone daserver; when running as part of a node that node's parent chain configuration is used (default 15) */ 'parent-chain-connection-attempts'?: number; - /** URL for L1 node, only used in standalone daserver; when running as part of a node that node's L1 configuration is used */ + /** URL for parent chain node, only used in standalone daserver; when running as part of a node that node's L1 configuration is used */ 'parent-chain-node-url'?: string; /** Data Availability Service timeout duration for Store requests (default 5s) */ 'request-timeout'?: string; @@ -410,7 +602,7 @@ export type NodeConfig = { /** enable storage/retrieval of sequencer batch data from a list of RPC endpoints; this should only be used by the batch poster and not in combination with other DAS storage types */ 'enable'?: boolean; }; - /** L1 address of SequencerInbox contract */ + /** parent chain address of SequencerInbox contract */ 'sequencer-inbox-address'?: string; }; 'delayed-sequencer'?: { @@ -435,9 +627,11 @@ export type NodeConfig = { 'require-chain-id'?: boolean; /** require feed version to be present on connect */ 'require-feed-version'?: boolean; + /** list of secondary URLs of sequencer feed source. Would be started in the order they appear in the list when primary feeds fails */ + 'secondary-url'?: string[]; /** duration to wait before timing out connection to sequencer feed (default 20s) */ 'timeout'?: string; - /** URL of sequencer feed source */ + /** list of primary URLs of sequencer feed source */ 'url'?: string[]; 'verify'?: { /** accept verified message from sequencer (default true) */ @@ -453,6 +647,10 @@ export type NodeConfig = { output?: { /** address to bind the relay feed output to */ 'addr'?: string; + 'backlog'?: { + /** the maximum number of messages each segment within the backlog can contain (default 240) */ + 'segment-limit'?: number; + }; /** delay the first messages sent to each client by this amount */ 'client-delay'?: string; /** duration to wait before timing out connections to client (default 15s) */ @@ -473,7 +671,7 @@ export type NodeConfig = { 'disable-signing'?: boolean; /** enable broadcaster */ 'enable'?: boolean; - /** enable per message deflate compression support (default true) */ + /** enable per message deflate compression support */ 'enable-compression'?: boolean; /** duration to wait before timing out HTTP to WS upgrade (default 1s) */ 'handshake-timeout'?: string; @@ -507,22 +705,6 @@ export type NodeConfig = { 'write-timeout'?: string; }; }; - 'forwarder'?: { - /** total time to wait before cancelling connection (default 30s) */ - 'connection-timeout'?: string; - /** time until idle connections are closed (default 15s) */ - 'idle-connection-timeout'?: string; - /** maximum number of idle connections to keep open (default 1) */ - 'max-idle-connections'?: number; - /** the Redis URL to recomend target via */ - 'redis-url'?: string; - /** minimal time between update retries (default 100ms) */ - 'retry-interval'?: string; - /** forwarding target update interval (default 1s) */ - 'update-interval'?: string; - }; - /** transaction forwarding target URL, or "null" to disable forwarding (if not sequencer) */ - 'forwarding-target'?: string; 'inbox-reader'?: { /** the maximum time to wait between inbox checks (if not enough new blocks are found) (default 1m0s) */ 'check-delay'?: string; @@ -536,6 +718,8 @@ export type NodeConfig = { 'max-blocks-to-read'?: number; /** the minimum number of blocks to read at once (when caught up lowers load on L1) (default 1) */ 'min-blocks-to-read'?: number; + /** mode to only read latest or safe or finalized L1 blocks. Enabling safe or finalized disables feed input and output. Defaults to latest. Takes string input, valid strings- latest, safe, finalized (default "latest") */ + 'read-mode'?: string; /** if adjust-blocks-to-read is enabled, the target number of messages to read at once (default 500) */ 'target-messages-read'?: number; }; @@ -543,7 +727,9 @@ export type NodeConfig = { 'lock'?: { /** should node always try grabing lock in background */ 'background-lock'?: boolean; - /** key for lock (default "node.maintenance.lock.simple-lock-key") */ + /** if false, always treat this as locked and don't write the lock to redis (default true) */ + 'enable'?: boolean; + /** key for lock */ 'key'?: string; /** how long lock is held (default 1m0s) */ 'lockout-duration'?: string; @@ -564,6 +750,10 @@ export type NodeConfig = { 'prune-interval'?: string; }; 'parent-chain-reader'?: { + 'dangerous'?: { + /** Dangerous! only meant to be used by system tests */ + 'wait-for-tx-approval-safe-poll'?: string; + }; /** enable reader connection (default true) */ 'enable'?: boolean; /** warns if the latest l1 block is at least this old (default 5m0s) */ @@ -572,53 +762,13 @@ export type NodeConfig = { 'poll-interval'?: string; /** do not attempt to subscribe to header events */ 'poll-only'?: boolean; + /** interval for subscribe error (default 5m0s) */ + 'subscribe-err-interval'?: string; /** timeout when waiting for a transaction (default 5m0s) */ 'tx-timeout'?: string; /** use l1 data about finalized/safe blocks (default true) */ 'use-finality-data'?: boolean; }; - 'recording-database'?: { - /** like trie-clean-cache for the separate, recording database (used for validation) (default 16) */ - 'trie-clean-cache'?: number; - /** like trie-dirty-cache for the separate, recording database (used for validation) (default 1024) */ - 'trie-dirty-cache'?: number; - }; - 'resource-mgmt'?: { - /** RPC calls are throttled if free system memory excluding the page cache is below this amount, expressed in bytes or multiples of bytes with suffix B, K, M, G. The limit should be set such that sufficient free memory is left for the page cache in order for the system to be performant */ - 'mem-free-limit'?: string; - }; - 'rpc'?: { - 'arbdebug'?: { - /** bounds the number of blocks arbdebug calls may return (default 256) */ - 'block-range-bound'?: number; - /** bounds the length of timeout queues arbdebug calls may return (default 512) */ - 'timeout-queue-bound'?: number; - }; - /** number of blocks a single bloom bit section vector holds (default 16384) */ - 'bloom-bits-blocks'?: number; - /** number of confirmation blocks before a bloom section is considered final (default 256) */ - 'bloom-confirms'?: number; - /** url to redirect classic requests, use "error:[CODE:]MESSAGE" to return specified error instead of redirecting */ - 'classic-redirect'?: string; - /** timeout for forwarded classic requests, where 0 = no timeout */ - 'classic-redirect-timeout'?: string; - /** timeout used for eth_call (0=infinite) (default 5s) */ - 'evm-timeout'?: string; - /** max number of blocks a fee history request may cover (default 1024) */ - 'feehistory-max-block-count'?: number; - /** log filter system maximum number of cached blocks (default 32) */ - 'filter-log-cache-size'?: number; - /** log filter system maximum time filters stay active (default 5m0s) */ - 'filter-timeout'?: string; - /** cap on computation gas that can be used in eth_call/estimateGas (0=infinite) (default 50000000) */ - 'gas-cap'?: number; - /** maximum depth for recreating state, measured in l2 gas (0=don't recreate state, -1=infinite, -2=use default value for archive or non-archive node (whichever is configured)) (default -2) */ - 'max-recreate-state-depth'?: number; - /** allow transactions that aren't EIP-155 replay protected to be submitted over the RPC (default true) */ - 'tx-allow-unprotected'?: boolean; - /** cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) */ - 'tx-fee-cap'?: number; - }; 'seq-coordinator'?: { /** if non-empty, launch an HTTP service binding to this address that returns status code 200 when chosen and 503 otherwise */ 'chosen-healthcheck-addr'?: string; @@ -673,48 +823,8 @@ export type NodeConfig = { /** (default 250ms) */ 'update-interval'?: string; }; - 'sequencer'?: { - 'dangerous'?: { - /** DANGEROUS! allows sequencer without coordinator. */ - 'no-coordinator'?: boolean; - }; - /** act and post to l1 as sequencer */ - 'enable'?: boolean; - 'forwarder'?: { - /** total time to wait before cancelling connection (default 30s) */ - 'connection-timeout'?: string; - /** time until idle connections are closed (default 1m0s) */ - 'idle-connection-timeout'?: string; - /** maximum number of idle connections to keep open (default 100) */ - 'max-idle-connections'?: number; - /** the Redis URL to recomend target via */ - 'redis-url'?: string; - /** minimal time between update retries (default 100ms) */ - 'retry-interval'?: string; - /** forwarding target update interval (default 1s) */ - 'update-interval'?: string; - }; - /** maximum acceptable time difference between the local time and the latest L1 block's timestamp (default 1h0m0s) */ - 'max-acceptable-timestamp-delta'?: string; - /** minimum delay between blocks (sets a maximum speed of block production) (default 100ms) */ - 'max-block-speed'?: string; - /** maximum gas executed in a revert for the sequencer to reject the transaction instead of posting it (anti-DOS) (default 31000) */ - 'max-revert-gas-reject'?: number; - /** maximum transaction size the sequencer will accept (default 95000) */ - 'max-tx-data-size'?: number; - /** size of the tx sender nonce cache (default 1024) */ - 'nonce-cache-size'?: number; - /** maximum amount of time to wait for a predecessor before rejecting a tx with nonce too high (default 1s) */ - 'nonce-failure-cache-expiry'?: string; - /** number of transactions with too high of a nonce to keep in memory while waiting for their predecessor (default 1024) */ - 'nonce-failure-cache-size'?: number; - /** size of the pending tx queue (default 1024) */ - 'queue-size'?: number; - /** maximum amount of time transaction can wait in queue (default 12s) */ - 'queue-timeout'?: string; - /** comma separated whitelist of authorized senders (if empty, everyone is allowed) */ - 'sender-whitelist'?: string; - }; + /** enable sequencer */ + 'sequencer'?: boolean; 'staker'?: { /** confirmation blocks (default 12) */ 'confirmation-blocks'?: number; @@ -733,9 +843,29 @@ export type NodeConfig = { /** clear database storage */ 'clear-dbstorage'?: boolean; }; - /** encodes items in a legacy way (as it was before dropping generics) (default true) */ + /** unit to measure the time elapsed since creation of transaction used for maximum fee cap calculation (default 10m0s) */ + 'elapsed-time-base'?: string; + /** weight given to the units of time elapsed used for maximum fee cap calculation (default 10) */ + 'elapsed-time-importance'?: number; + 'external-signer'?: { + /** external signer address */ + 'address'?: string; + /** rpc client cert */ + 'client-cert'?: string; + /** rpc client private key */ + 'client-private-key'?: string; + /** external signer method (default "eth_signTransaction") */ + 'method'?: string; + /** external signer root CA */ + 'root-ca'?: string; + /** external signer url */ + 'url'?: string; + }; + /** encodes items in a legacy way (as it was before dropping generics) */ 'legacy-storage-encoding'?: boolean; - /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 10) */ + /** mathematical formula to calculate maximum fee cap gwei the result of which would be float64. This expression is expected to be evaluated please refer https://github.com/Knetic/govaluate/blob/master/MANUAL.md to find all available mathematical operators. Currently available variables to construct the formula are BacklogOfBatches, UrgencyGWei, ElapsedTime, ElapsedTimeBase, ElapsedTimeImportance, and TargetPriceGWei (default "((BacklogOfBatches * UrgencyGWei) ** 2) + ((ElapsedTime/ElapsedTimeBase) ** 2) * ElapsedTimeImportance + TargetPriceGWei") */ + 'max-fee-cap-formula'?: string; + /** the maximum number of transactions to have queued in the mempool at once (0 = unlimited) (default 1) */ 'max-mempool-transactions'?: number; /** the maximum number of unconfirmed transactions to track at once (0 = unlimited) */ 'max-queued-transactions'?: number; @@ -800,18 +930,6 @@ export type NodeConfig = { /** high gas threshold */ 'high-gas-threshold'?: number; }; - 'redis-lock'?: { - /** should node always try grabing lock in background */ - 'background-lock'?: boolean; - /** key for lock (default "node.staker.redis-lock.simple-lock-key") */ - 'key'?: string; - /** how long lock is held (default 1m0s) */ - 'lockout-duration'?: string; - /** this node's id prefix when acquiring the lock (optional) */ - 'my-id'?: string; - /** how long between consecutive calls to redis (default 10s) */ - 'refresh-duration'?: string; - }; /** redis url for L1 validator */ 'redis-url'?: string; /** how often the L1 validator should check the status of the L1 rollup and maybe take action with its stake (default 1m0s) */ @@ -830,29 +948,41 @@ export type NodeConfig = { 'block-build-sequencer-inbox-lag'?: number; /** allowed lag between local and remote messages (default 15) */ 'coordinator-msg-lag'?: number; + /** wait for block validator to complete before returning finalized block number */ + 'finalized-block-wait-for-block-validator'?: boolean; + /** wait for block validator to complete before returning safe block number */ + 'safe-block-wait-for-block-validator'?: boolean; }; 'transaction-streamer'?: { /** delay when polling calls to execute messages (default 100ms) */ 'execute-message-loop-delay'?: string; - /** maximum cache of pending broadcaster messages (default 1024) */ + /** maximum cache of pending broadcaster messages (default 50000) */ 'max-broadcaster-queue-size'?: number; /** maximum number of messages to attempt to resequence on reorg (0 = never resequence, -1 = always resequence) (default 1024) */ 'max-reorg-resequence-depth'?: number; }; - /** retain the ability to lookup transactions by hash for the past N blocks (0 = all blocks) (default 126230400) */ - 'tx-lookup-limit'?: number; - 'tx-pre-checker'?: { - /** how long ago should the storage conditions from eth_SendRawTransactionConditional be true, 0 = don't check old state (default 2) */ - 'required-state-age'?: number; - /** maximum number of blocks to look back while looking for the seconds old state, 0 = don't limit the search (default 4) */ - 'required-state-max-blocks'?: number; - /** how strict to be when checking txs before forwarding them. 0 = accept anything, 10 = should never reject anything that'd succeed, 20 = likely won't reject anything that'd succeed, 30 = full validation which may reject txs that would succeed */ - 'strictness'?: number; - }; + }; + 'p2p'?: { + /** P2P bootnodes */ + 'bootnodes'?: string[]; + /** P2P bootnodes v5 */ + 'bootnodes-v5'?: string[]; + /** P2P discovery v4 */ + 'discovery-v4'?: boolean; + /** P2P discovery v5 */ + 'discovery-v5'?: boolean; + /** P2P listen address */ + 'listen-addr'?: string; + /** P2P max peers (default 50) */ + 'max-peers'?: number; + /** P2P no dial (default true) */ + 'no-dial'?: boolean; + /** P2P no discovery (default true) */ + 'no-discovery'?: boolean; }; 'parent-chain'?: { connection?: { - /** limit size of arguments in log entries */ + /** limit size of arguments in log entries (default 2048) */ 'arg-log-limit'?: number; /** how long to wait for initial connection (default 1m0s) */ 'connection-wait'?: string; @@ -860,6 +990,8 @@ export type NodeConfig = { 'jwtsecret'?: string; /** number of retries in case of failure(0 mean one attempt) (default 2) */ 'retries'?: number; + /** delay between retries */ + 'retry-delay'?: string; /** Errors matching this regular expression are automatically retried */ 'retry-errors'?: string; /** per-response timeout (0-disabled) (default 1m0s) */ @@ -905,7 +1037,9 @@ export type NodeConfig = { port?: number; }; 'rpc'?: { - /** the maximum response size for a JSON-RPC request measured in bytes (-1 means no limit) (default 10000000) */ + /** the maximum number of requests in a batch (0 means no limit) (default 1000) */ + 'batch-request-limit'?: number; + /** the maximum response size for a JSON-RPC request measured in bytes (0 means no limit) (default 10000000) */ 'max-batch-response-size'?: number; }; 'validation'?: { @@ -929,13 +1063,19 @@ export type NodeConfig = { }; 'jit'?: { /** use Cranelift instead of LLVM when validating blocks using the jit-accelerated block validator (default true) */ - cranelift?: boolean; + 'cranelift'?: boolean; + /** if memory used by a jit wasm exceeds this limit, a warning is logged (default 4294967296) */ + 'wasm-memory-usage-limit'?: number; /** number of concurrent validation threads */ - workers?: number; + 'workers'?: number; }; /** use jit for validation (default true) */ 'use-jit'?: boolean; 'wasm'?: { + /** list of WASM module roots to check if the on-chain WASM module root belongs to on node startup */ + 'allowed-wasm-module-roots'?: string[]; + /** enable check for compatibility of on-chain WASM module root with node (default true) */ + 'enable-wasmroots-check'?: boolean; /** path to machine folders, each containing wasm files (machine.wavm.br, replay.wasm) */ 'root-path'?: string; }; From 6f25f3b4f81d1e8c80bf25d3512ce6f92809cf8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Thu, 22 Feb 2024 15:03:02 +0100 Subject: [PATCH 15/20] use generated type --- src/prepareNodeConfig.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prepareNodeConfig.ts b/src/prepareNodeConfig.ts index fd77df33..7651e8ab 100644 --- a/src/prepareNodeConfig.ts +++ b/src/prepareNodeConfig.ts @@ -1,5 +1,5 @@ +import { NodeConfig } from './types/NodeConfig.generated'; import { - NodeConfig, NodeConfigChainInfoJson, NodeConfigDataAvailabilityRpcAggregatorBackendsJson, } from './types/NodeConfig'; @@ -100,8 +100,8 @@ export function prepareNodeConfig({ 'http': { addr: '0.0.0.0', port: 8449, - vhosts: '*', - corsdomain: '*', + vhosts: ['*'], + corsdomain: ['*'], api: ['eth', 'net', 'web3', 'arb', 'debug'], }, 'node': { @@ -149,7 +149,7 @@ export function prepareNodeConfig({ 'parent-chain-node-url': parentChainRpcUrl, 'rest-aggregator': { enable: true, - urls: 'http://localhost:9877', + urls: ['http://localhost:9877'], }, 'rpc-aggregator': { 'enable': true, From e8a7d16ad396a6d8709e56b5c629e27fd2bcb5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Thu, 22 Feb 2024 15:28:50 +0100 Subject: [PATCH 16/20] remove hardcoded type --- src/types/NodeConfig.ts | 75 ----------------------------------------- 1 file changed, 75 deletions(-) diff --git a/src/types/NodeConfig.ts b/src/types/NodeConfig.ts index ac38940f..ac7bcf06 100644 --- a/src/types/NodeConfig.ts +++ b/src/types/NodeConfig.ts @@ -26,78 +26,3 @@ export type NodeConfigDataAvailabilityRpcAggregatorBackendsJson = [ signermask: number; }, ]; - -export type NodeConfig = { - 'chain': { - /** - * This is a stringified `NodeConfigChainInfoJson` object. - */ - 'info-json': string; - 'name': string; - }; - 'parent-chain': { - connection: { - url: string; - }; - }; - 'http': { - addr: string; - port: number; - vhosts: string; - corsdomain: string; - api: string[]; - }; - 'node': { - 'sequencer': boolean; - 'delayed-sequencer': { - 'enable': boolean; - 'use-merge-finality': boolean; - 'finalize-distance': number; - }; - 'batch-poster': { - 'max-size': number; - 'enable': boolean; - 'parent-chain-wallet': { - 'private-key': string; - }; - }; - 'staker': { - 'enable': boolean; - 'strategy': string; - 'parent-chain-wallet': { - 'private-key': string; - }; - }; - 'data-availability'?: { - 'enable': boolean; - 'sequencer-inbox-address': string; - 'parent-chain-node-url': string; - 'rest-aggregator': { - enable: boolean; - urls: string; - }; - 'rpc-aggregator': { - 'enable': boolean; - 'assumed-honest': number; - /** - * This is a stringified `NodeConfigDataAvailabilityRpcAggregatorBackendsJson` object. - */ - 'backends': string; - }; - }; - 'dangerous': { - 'no-sequencer-coordinator': boolean; - }; - }; - 'execution': { - 'forwarding-target': string; - 'sequencer': { - 'max-tx-data-size': number; - 'enable': boolean; - 'max-block-speed': string; - }; - 'caching': { - archive: boolean; - }; - }; -}; From 5e77c856841ddb389705ffbb01132cfa6b4b38bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragi=C5=A1a=20Spasojevi=C4=87?= Date: Thu, 22 Feb 2024 18:08:58 +0100 Subject: [PATCH 17/20] start cleaning up types --- src/scripts/generateNodeConfigType.ts | 47 +++++++++++++++------------ 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index ab5833ce..adc18d7c 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -1,6 +1,6 @@ import { execSync } from 'child_process'; import { readFileSync, rmSync } from 'fs'; -import { Project, Writers } from 'ts-morph'; +import { Project, WriterFunction, Writers } from 'ts-morph'; const { objectType } = Writers; @@ -110,44 +110,50 @@ function parseCliOptions(fileContents: string): CliOption[] { }); } -type CliOptionNestedObject = any; +type CliOptionNestedObject = { + [key: string]: CliOption | CliOptionNestedObject; +}; function createCliOptionsNestedObject(options: CliOption[]): CliOptionNestedObject { - const result: CliOptionNestedObject = {}; + const result: CliOption | CliOptionNestedObject = {}; options.forEach((option) => { let path = option.name.split('.'); - let current = result; + let current: CliOptionNestedObject = result; for (let i = 0; i < path.length; i++) { - if (!current[path[i]]) { + const pathIndex = path[i]; + + if (!current[pathIndex]) { if (i === path.length - 1) { - current[path[i]] = option; + current[pathIndex] = option; } else { - current[path[i]] = {}; + current[pathIndex] = {}; } } - current = current[path[i]]; + // @ts-ignore + current = current[pathIndex]; } }); return result; } -//@ts-ignore -function getType(something: any) { - if (typeof something === 'object' && 'type' in something) { - return something.type; +function isCliOption(value: CliOption | CliOptionNestedObject): value is CliOption { + return 'type' in value; +} + +function getTypeRecursively(value: CliOption | CliOptionNestedObject): string | WriterFunction { + if (isCliOption(value)) { + return value.type; } return objectType({ - //@ts-ignore - properties: Object.entries(something).map(([key, value]) => ({ - name: `'${key}'`, - type: getType(value), - //@ts-ignore - docs: value.docs, + properties: Object.entries(value).map(([currentKey, currentValue]) => ({ + name: `'${currentKey}'`, + type: getTypeRecursively(currentValue), + docs: (currentValue.docs ?? []) as string[], // make it optional hasQuestionToken: true, })), @@ -160,7 +166,7 @@ function main() { // read and parse the file const content = readFileSync(nitroNodeHelpOutputFile, 'utf8'); const cliOptions = parseCliOptions(content); - const obj = createCliOptionsNestedObject(cliOptions); + const cliOptionsNestedObject = createCliOptionsNestedObject(cliOptions); const sourceFile = new Project().createSourceFile('./src/types/NodeConfig.generated.ts', '', { overwrite: true, @@ -171,8 +177,7 @@ function main() { // append NodeConfig type declaration sourceFile.addTypeAlias({ name: 'NodeConfig', - // @ts-ignore - type: getType(obj), + type: getTypeRecursively(cliOptionsNestedObject), docs: ['Nitro node configuration options'], isExported: true, }); From c3230f596500c10b8dfd0743b1b3f2746f774368 Mon Sep 17 00:00:00 2001 From: spsjvc Date: Thu, 22 Feb 2024 18:33:28 +0100 Subject: [PATCH 18/20] clean up types more --- src/scripts/generateNodeConfigType.ts | 39 ++++++++++++++++----------- src/types/NodeConfig.generated.ts | 6 ++--- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index adc18d7c..a34dbe3d 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -115,25 +115,21 @@ type CliOptionNestedObject = { }; function createCliOptionsNestedObject(options: CliOption[]): CliOptionNestedObject { - const result: CliOption | CliOptionNestedObject = {}; + const result: CliOptionNestedObject = {}; options.forEach((option) => { - let path = option.name.split('.'); + let paths = option.name.split('.'); let current: CliOptionNestedObject = result; - for (let i = 0; i < path.length; i++) { - const pathIndex = path[i]; + for (let i = 0; i < paths.length; i++) { + const path = paths[i]; + const pathIsFinal = i === paths.length - 1; - if (!current[pathIndex]) { - if (i === path.length - 1) { - current[pathIndex] = option; - } else { - current[pathIndex] = {}; - } + if (typeof current[path] === 'undefined') { + current[path] = pathIsFinal ? option : {}; } - // @ts-ignore - current = current[pathIndex]; + current = current[path] as CliOptionNestedObject; } }); @@ -144,16 +140,27 @@ function isCliOption(value: CliOption | CliOptionNestedObject): value is CliOpti return 'type' in value; } +function getDocs(value: CliOption | CliOptionNestedObject): string[] { + if (isCliOption(value)) { + return value.docs; + } + + // docs only available for "primitive" properties, not objects + return []; +} + function getTypeRecursively(value: CliOption | CliOptionNestedObject): string | WriterFunction { + // if we reached the "primitive" property, we can just return its type if (isCliOption(value)) { return value.type; } + // if not, recursively figure out the type for each of the object's properties return objectType({ properties: Object.entries(value).map(([currentKey, currentValue]) => ({ name: `'${currentKey}'`, type: getTypeRecursively(currentValue), - docs: (currentValue.docs ?? []) as string[], + docs: getDocs(currentValue), // make it optional hasQuestionToken: true, })), @@ -163,15 +170,16 @@ function getTypeRecursively(value: CliOption | CliOptionNestedObject): string | function main() { // run --help on the nitro binary and save the output to a file execSync(`docker run --rm ${nitroNodeImage} --help >& ${nitroNodeHelpOutputFile}`); + // read and parse the file const content = readFileSync(nitroNodeHelpOutputFile, 'utf8'); const cliOptions = parseCliOptions(content); const cliOptionsNestedObject = createCliOptionsNestedObject(cliOptions); + // create the new source file const sourceFile = new Project().createSourceFile('./src/types/NodeConfig.generated.ts', '', { overwrite: true, }); - // append header sourceFile.insertText(0, generateHeader()); // append NodeConfig type declaration @@ -181,9 +189,10 @@ function main() { docs: ['Nitro node configuration options'], isExported: true, }); + // save file to disk sourceFile.saveSync(); - + // remove output file that we used for parsing rmSync(nitroNodeHelpOutputFile); } diff --git a/src/types/NodeConfig.generated.ts b/src/types/NodeConfig.generated.ts index d87fa856..c8a770c8 100644 --- a/src/types/NodeConfig.generated.ts +++ b/src/types/NodeConfig.generated.ts @@ -3,7 +3,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT BE EDITED MANUALLY // // IMAGE: offchainlabs/nitro-node:v2.2.5-a20a1c7 -// TIMESTAMP: 2024-02-22T14:01:14.918Z +// TIMESTAMP: 2024-02-22T17:33:00.049Z // // --- /** Nitro node configuration options */ @@ -29,7 +29,7 @@ export type NodeConfig = { 'end-block'?: number; /** mode to run the blocks-reexecutor on. Valid modes full and random. full - execute all the blocks in the given range. random - execute a random sample range of blocks with in a given range (default "random") */ 'mode'?: string; - /** number of threads to parallelize blocks re-execution (default 10) */ + /** number of threads to parallelize blocks re-execution (default 12) */ 'room'?: number; /** first block number of the block range for re-execution */ 'start-block'?: number; @@ -494,7 +494,7 @@ export type NodeConfig = { 'memory-free-limit'?: string; /** pending upgrade wasm module root to additionally validate (hash, 'latest' or empty) (default "latest") */ 'pending-upgrade-module-root'?: string; - /** record that many blocks ahead of validation (larger footprint) (default 20) */ + /** record that many blocks ahead of validation (larger footprint) (default 24) */ 'prerecorded-blocks'?: number; /** poll time to check validations (default 1s) */ 'validation-poll'?: string; From fd997ab8ecc424c363b3300b99c0d77980406ee8 Mon Sep 17 00:00:00 2001 From: spsjvc Date: Fri, 23 Feb 2024 11:57:14 +0100 Subject: [PATCH 19/20] have default tag --- src/scripts/generateNodeConfigType.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index a34dbe3d..074e8161 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -5,12 +5,14 @@ import { Project, WriterFunction, Writers } from 'ts-morph'; const { objectType } = Writers; function getNitroNodeImageTag(): string { + const defaultNitroNodeTag = 'v2.2.5-a20a1c7'; const argv = process.argv.slice(2); if (argv.length < 2 || argv[0] !== '--nitro-node-tag') { - throw new Error( - `You must specify the nitro node image tag, e.g. "--nitro-node-tag v2.1.3-e815395"`, + console.log( + `Using default nitro-node tag since none was provided. If you want to specify a tag, you can do "--nitro-node-tag v2.2.2-8f33fea".`, ); + return defaultNitroNodeTag; } return argv[1]; @@ -20,7 +22,7 @@ const nitroNodeTag = getNitroNodeImageTag(); const nitroNodeImage = `offchainlabs/nitro-node:${nitroNodeTag}`; const nitroNodeHelpOutputFile = `${nitroNodeImage.replace('/', '-')}-help.txt`; -console.log(`Using image ${nitroNodeImage}`); +console.log(`Using image "${nitroNodeImage}".`); function generateHeader() { return [ From 4bce6937f82c397b65773f2136dd6cbe977e648c Mon Sep 17 00:00:00 2001 From: spsjvc Date: Fri, 23 Feb 2024 12:00:55 +0100 Subject: [PATCH 20/20] make posix compliant --- src/scripts/generateNodeConfigType.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/generateNodeConfigType.ts b/src/scripts/generateNodeConfigType.ts index 074e8161..b39e63ac 100644 --- a/src/scripts/generateNodeConfigType.ts +++ b/src/scripts/generateNodeConfigType.ts @@ -171,7 +171,7 @@ function getTypeRecursively(value: CliOption | CliOptionNestedObject): string | function main() { // run --help on the nitro binary and save the output to a file - execSync(`docker run --rm ${nitroNodeImage} --help >& ${nitroNodeHelpOutputFile}`); + execSync(`docker run --rm ${nitroNodeImage} --help > ${nitroNodeHelpOutputFile} 2>&1`); // read and parse the file const content = readFileSync(nitroNodeHelpOutputFile, 'utf8');