Fix/gas usage monitoring - #152
Conversation
Predict the gas (Soroban resource) cost of a contract call from its simulation, compare against configurable per-transaction limits, and log over-budget calls to guard against gas-exhaustion DoS. Closes Vero-protocol#6 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…e-monitor Predict the gas (Soroban resource) cost of a contract call from its simulation, compare against configurable per-transaction limits, and log over-budget calls to guard against gas-exhaustion DoS. Closes Vero-protocol#6 Co-authored-by: Olusegun Kehinde <olusegunkehindejones@gmail.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Move the Windows-only @next/swc-win32-x64-msvc binary from dependencies to optionalDependencies so npm ci skips it on non-Windows platforms instead of failing with EBADPLATFORM. Next.js resolves the correct platform swc binary on its own. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…x-ci-install fix: make npm ci succeed on Linux/CI
- jest.setup: polyfill TextEncoder/TextDecoder and Web Crypto subtle (jsdom lacks them) so session encryption paths run in tests - logger: pass Uint8Array views (not raw ArrayBuffer) to subtle.decrypt so it works across the jsdom/node realm boundary - txBuilder test: mark simulation mock as parsed with a result so assembleTransaction consumes it instead of re-parsing - VoteButton test: declare missing mockUseNetwork - wallet tests: assert persisted values via getSessionItem (decrypts) now that the wallet stores encrypted session data Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ing-tests - jest.setup: polyfill TextEncoder/TextDecoder and Web Crypto subtle (jsdom lacks them) so session encryption paths run in tests - logger: pass Uint8Array views (not raw ArrayBuffer) to subtle.decrypt so it works across the jsdom/node realm boundary - txBuilder test: mark simulation mock as parsed with a result so assembleTransaction consumes it instead of re-parsing - VoteButton test: declare missing mockUseNetwork - wallet tests: assert persisted values via getSessionItem (decrypts) now that the wallet stores encrypted session data Co-authored-by: Olusegun Kehinde <olusegunkehindejones@gmail.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add a maxHistory option (default DEFAULT_MAX_HISTORY=1000) so the records array no longer grows without limit in a long-running relayer. Oldest records are dropped once the cap is exceeded; maxHistory <= 0 keeps history unbounded. Addresses Devin Review feedback on #1. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…or-maxhistory fix: cap GasUsageMonitor retained history to bound memory
Signed-off-by: Olusegun Kehinde <olusegunkehindejones@gmail.com>
Signed-off-by: Olusegun Kehinde <olusegunkehindejones@gmail.com>
Signed-off-by: Olusegun Kehinde <olusegunkehindejones@gmail.com>
Signed-off-by: Olusegun Kehinde <olusegunkehindejones@gmail.com>
|
Thanks for this — the gas-usage monitor itself ( This branch has drifted quite far from I've cherry-picked the gas-monitor module as-is onto a fresh branch off current |
Closes #47
Closes #52
Fix/gas usage monitoring