Repository navigation
fix(sdk): bound the event queue and make the packages publishable - #5
Merged
Merged
Conversation
HeightproofClient re-queued every failed batch with no limit, so a Heightproof outage grew memory in the host application without bound, and re-queued batches the server had rejected (401, 400, 413), which then sat at the head of the queue and blocked every later batch for good. Requests also had no timeout. - Cap the in-memory queue (maxQueueSize, default 5000), dropping the oldest. - Retry only network errors, timeouts, 408, 429 and 5xx; drop other 4xx. - Abort ingestion requests after requestTimeoutMs (default 5000). - Report drops through onDrop(count, reason) and stats(). @heightproof/web3 marked every failed RPC call as an auth failure, which added the auth_failure signal (+24) to ordinary RPC errors. Only 401/403 count now. Publishing: shared, sdk-node and web3 get descriptions, license, repository, exports, a files list (dist, README, LICENSE only), publishConfig access public, prepublishOnly build, and READMEs. express becomes an optional peer of sdk-node, since it imports only Express types; installing @heightproof/web3 no longer pulls in Express.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The README says a Heightproof outage cannot take down the monitored app. The SDK did not back that up:
HeightproofClientre-queued every failed batch with no limit, so an outage grew the host's memory without bound.401,400,413). Re-queued at the head, a rejected batch blocked every later batch permanently.@heightproof/web3setrequest.auth.failedon every failed RPC call, addingauth_failure(+24) to ordinary RPC errors.Changes
maxQueueSize(default 5000): oldest events dropped beyond it.408,429,5xx; drop other4xx.requestTimeoutMs(default 5000) viaAbortSignal.timeout.onDrop(count, reason)andstats()so drops are visible to the host.401/403count as auth failures.Publishing readiness
@heightproof/shared,@heightproof/sdk-node,@heightproof/web3now have descriptions, license, repository,exports, afileslist (tarballs contain onlydist, README, LICENSE),publishConfig.access: public,prepublishOnlybuild, and READMEs.expressbecomes an optional peer ofsdk-node(it imports only Express types), so installing@heightproof/web3no longer pulls in Express.Verification
npm packof all three, installed into an empty project outside the monorepo: 5 packages installed, no Express; 25 calls through the packed@heightproof/web3all arrived in a running Heightproof.