-
Notifications
You must be signed in to change notification settings - Fork 103
transfer route AA fixes + experimental mine worker polling interval env vars #897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -103,6 +103,16 @@ export const env = createEnv({ | |||||||||||||||||||||||||||||
| .default(30 * 60), | ||||||||||||||||||||||||||||||
| // Sets the max gas price for a transaction attempt. Most RPCs reject transactions above a certain gas price. Default: 10^18 wei. | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MAX_GAS_PRICE_WEI: z.coerce.number().default(10 ** 18), | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MINE_WORKER_BASE_POLL_INTERVAL_SECONDS: z.coerce | ||||||||||||||||||||||||||||||
| .number() | ||||||||||||||||||||||||||||||
| .default(2), | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MINE_WORKER_MAX_POLL_INTERVAL_SECONDS: z.coerce | ||||||||||||||||||||||||||||||
| .number() | ||||||||||||||||||||||||||||||
| .default(20), | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MINE_WORKER_POLL_INTERVAL_SCALING_FACTOR: z.coerce | ||||||||||||||||||||||||||||||
| .number() | ||||||||||||||||||||||||||||||
| .gt(0.0, "scaling factor must be greater than 0") | ||||||||||||||||||||||||||||||
| .default(1.0), | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| clientPrefix: "NEVER_USED", | ||||||||||||||||||||||||||||||
| client: {}, | ||||||||||||||||||||||||||||||
|
|
@@ -151,6 +161,12 @@ export const env = createEnv({ | |||||||||||||||||||||||||||||
| CUSTOM_HMAC_AUTH_CLIENT_ID: process.env.CUSTOM_HMAC_AUTH_CLIENT_ID, | ||||||||||||||||||||||||||||||
| CUSTOM_HMAC_AUTH_CLIENT_SECRET: process.env.CUSTOM_HMAC_AUTH_CLIENT_SECRET, | ||||||||||||||||||||||||||||||
| ACCOUNT_CACHE_SIZE: process.env.ACCOUNT_CAHCE_SIZE, | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MINE_WORKER_BASE_POLL_INTERVAL_SECONDS: | ||||||||||||||||||||||||||||||
| process.env.EXPERIMENTAL__MINE_WORKER_BASE_POLL_INTERVAL_SECONDS, | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MINE_WORKER_MAX_POLL_INTERVAL_SECONDS: | ||||||||||||||||||||||||||||||
| process.env.EXPERIMENTAL__MINE_WORKER_MAX_POLL_INTERVAL_SECONDS, | ||||||||||||||||||||||||||||||
| EXPERIMENTAL__MINE_WORKER_POLL_INTERVAL_SCALING_FACTOR: | ||||||||||||||||||||||||||||||
| process.env.EXPERIMENTAL__MINE_WORKER_POLL_INTERVAL_SCALING_FACTOR, | ||||||||||||||||||||||||||||||
|
Comment on lines
163
to
+169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in runtimeEnvStrict key prevents variable exposure
- ACCOUNT_CACHE_SIZE: process.env.ACCOUNT_CAHCE_SIZE,
+ ACCOUNT_CACHE_SIZE: process.env.ACCOUNT_CACHE_SIZE,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| onValidationError: (error: ZodError) => { | ||||||||||||||||||||||||||||||
| console.error( | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Validate base ≤ max & keep variables coherent
The schema allows a configuration where
EXPERIMENTAL__MINE_WORKER_BASE_POLL_INTERVAL_SECONDSis larger thanEXPERIMENTAL__MINE_WORKER_MAX_POLL_INTERVAL_SECONDS, producing a negative‐growth back-off once theMath.mincap kicks in.Consider adding a cross-field refinement to guarantee
base ≤ max, and possibly an upper bound for the scaling factor to avoid runaway delays.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base can be greater than max, combined with a low scaling factor this actually makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d4mr Thank you for the clarification! You're absolutely right - that's actually a clever configuration pattern. With a low scaling factor, having
base > maxallows for fine-grained control over the backoff curve. For example, if base=30, max=20, and scaling_factor=0.1, the intervals would be 3s, 6s, 9s, etc., gradually ramping up until hitting the 20s cap. This gives much more granular control over the polling behavior than I initially realized.I appreciate you explaining the intended design - it makes perfect sense now!
ʕ •ᴥ•ʔ Thanks for teaching me something new!
✏️ Learnings added