Repository navigation
Refuse addresses Alchemy cannot serve and keep one address's gap out of health (B08) - #22
Closed
AsyncAssassin wants to merge 1 commit into
Closed
AsyncAssassin wants to merge 1 commit into
AsyncAssassin wants to merge 1 commit into
Conversation
… out of health Under type=alchemy the seeded local-evm chain is enabled but has no Alchemy network. An address registered there got 201, its first sync turned the provider state to FETCH_FAILED and /actuator/health into 503, contrary to the 0.4.0 note that one bad address no longer does, and the next start stopped on the rollout preflight. The provider port says whether it serves a chain, and registration refuses one it cannot serve with 404 Unsupported chain; the detail now names that case. A configuration gap of one address, its chain without a network, its asset without an enabled config, or a block larger than a page, is an AddressConfigurationException: still terminal for its runs, but shown as lastDataError while health stays UP. A cursor another provider wrote, such as the demo simulator's, now fails with a message that says so and points to the runbook. The 0.4.0 notes also said that after an outage at startup sync runs retry until Alchemy answers; they retry up to max-attempts and then fail, and nothing probes again. The README, the runbook, and the preflight's description now say so.
Owner
Author
|
Combined into #23 together with the other batch-1 fixes, so they merge without a rebase per PR. This description keeps the detailed evidence for its fix. |
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.
Summary
B08 from the merged review of v0.4.0, with the CHANGELOG wording of B19 and the foreign-cursor case deferred from #15; 0.4.1 is released once all fixes are merged. Under
type=alchemythe seededlocal-evmchain is enabled but has no Alchemy network. An address registered there got201. Its first sync turned the provider state toFETCH_FAILEDand/actuator/healthinto503, contrary to the 0.4.0 note that one bad address no longer does. The next start then stopped on the rollout preflight, and the address could only be fixed with SQL.ChainProviderPort.supportsChain(chainId)(defaulttrue) tells whether the active provider serves a chain; Alchemy serves the mapped ones. Registration refuses any other chain with404 Unsupported chain, as decided for this finding. The detail now names the case: "The chain is not configured, is disabled, or is not served by the active provider." The three cases stay indistinguishable, as before.AddressConfigurationException, a subclass ofProviderConfigurationException. That covers its chain without a network, its asset without an enabled config, and a block with more events than a page. It stays terminal for that address's runs, but it is shown aslastDataErrorand health staysUP, like invalid data. A rejected key or an outage still turns healthDOWN.docs/alchemy-runbook.mdhas the SQL.sim:…after a demo run on the same database, now fails with "…is not valid JSON, so another provider wrote it; clear the address's sync_cursors row to start it under Alchemy (docs/alchemy-runbook.md, section 6)". The runbook row gives the SQL and what the next start skips.max-attempts(five by default, about 7.5 minutes of backoff) and then fail, and nothing probes again. The README, the runbook, and the KDoc now say so, and[Unreleased]corrects the 0.4.0 note instead of rewriting the released entry. A periodic re-probe stays with B19 in batch 3.CHANGELOG.mdlists the changes under[Unreleased]→ Fixed;docs/api.md,docs/architecture.md, anddocs/testing.mddescribe them.Verification
./gradlew clean check: 276 tests, 0 failures, 2 skipped (the env-gated Alchemy live smoke).AlchemyChainProviderTests: a request forlocal-evm, and one whose asset has no enabled config, throwAddressConfigurationExceptionwithout an RPC call. The state staysprobe-succeeded, the reason islastDataError, and health isUP.supportsChainis true foreth-sepoliaonly.AlchemyChainProviderHealthIndicatorTestsencoded the old behavior, an unmapped chain turning healthDOWN; it now expectsUPwithlastDataError.AlchemyProviderSyncIntegrationTests(e2ewithtype=alchemy): registering onlocal-evmthrowsUnsupportedChainExceptionand stores nothing.AccountAndAddressApiIntegrationTestschecks the new404detail.AlchemyCursorTests: asim:token and a JSON cursor markedhttpname the fix.Mutation check: each change removed on its own turns its test red. That covers the registration check,
supportsChain, the data-error branch, and the cursor message.Live against the real Alchemy Sepolia endpoint (
prod,type=alchemy; the key only in the environment, 0 occurrences in the log), themainjar against this branch:mainlocal-evm201404 Unsupported chaineth-sepolia201201SUCCEEDEDSUCCEEDEDalchemyChainProviderhealthUP,fetch-succeededUP,fetch-succeededThis PR and #15 to #21 each add a section under
[Unreleased]inCHANGELOG.md, so each later merge needs a one-file rebase. The other files merge cleanly with all of them.