Commit Graph

1672 Commits

Author SHA1 Message Date
Vadim Filin
24d54d34d7 Update chains (#814) 2026-04-23 17:45:41 +02:00
Artem Rootman
ed7cfdc90b Add client_type label to upstream lag and availability metrics (#815) 2026-04-23 14:26:59 +00:00
Vadim Filin
5414e06e46 Add support for Algorand Virtual Machine (AVM) blockchain (#813)
* add AVM blockchain type support for Algorand

Introduce a new blockchain type `avm` (Algorand Virtual Machine) so
Algorand-based chains (Mainnet, Testnet, Betanet) declared in chains.yaml
can be parsed and driven through dshackle's generic polling pipeline.

Key additions:
- BlockchainType.AVM (JSON_RPC) and `avm` mapping in chain codegen
- AvmChainSpecific: polls `algod_getBlock` for latest block and uses
  `algod_status` / `algod_genesis` for health and settings validation
- DefaultAvmMethods: allowed algod_* RPC surface with send-transaction
  broadcast quorum and hardcoded `algod_chainId` / `algod_genesisId`
- AvmLowerBoundService / AvmLowerBoundStateDetector for lower-bound tracking
- Registration in ChainSpecificRegistry and CallTargetsHolder
- Unit tests for block parsing, sync validation and method policies

https://claude.ai/code/session_01TZ64DZis9YaJSU3oMwtRLe

* inline DummyChainReader in AVM test

Match the Starknet test pattern and drop the dedicated DummyChainReader
file; instead pass an anonymous ChainReader directly where needed.

https://claude.ai/code/session_01TZ64DZis9YaJSU3oMwtRLe

* fix AVM network validation logic

Validation used AND across all conditions, so when netVersion was 0
(typical for non-EVM chains) the check short-circuited and allowed a
mismatching chain.chainId through. Simplify to the Cosmos pattern:
reject when chain.chainId is set and doesn't match genesis.network.

https://claude.ai/code/session_01TZ64DZis9YaJSU3oMwtRLe

* switch AVM to REST transport for native algod nodes

Native Algorand algod nodes expose a REST API (/v2/status, /v2/blocks,
/v2/transactions, ...) rather than JSON-RPC, so drive AVM upstreams
through dshackle's REST reader instead:

- BlockchainType.AVM is now ApiType.REST
- AvmChainSpecific polls GET#/v2/status for latest block info and uses
  GET#/v2/genesis for chain-id validation, both via RestParams
- DefaultAvmMethods exposes the algod /v2 endpoints with VERB#/path
  identifiers (POST#/v2/transactions uses BroadcastQuorum for sends)
- Tests updated to match the REST-based method names

https://claude.ai/code/session_01TZ64DZis9YaJSU3oMwtRLe

* align AVM endpoints with algod OpenAPI spec

Validated the AVM method surface against the official algod spec
(algorand/go-algorand algod.oas3.yml) and corrected mismatches:

Wrong paths removed:
- GET /v2/genesis, /v2/versions, /v2/health, /v2/ready, /v2/metrics
  (these exist at root level, not under /v2/)
- GET /v2/blocks/{round}/header (use header-only query on /v2/blocks/{round})
- GET /v2/blocks/{round}/transactions (no such path)
- GET /v2/lightheader/{round} (real path is /v2/blocks/{round}/lightheader/proof)
- POST /v2/transactions/dryrun (real path is /v2/teal/dryrun, already listed)

Added real endpoints:
- Root: GET /genesis, /health, /ready, /metrics, /versions, /swagger.json
- /v2/blocks/*/txids, /v2/blocks/*/logs, /v2/blocks/*/lightheader/proof
- /v2/accounts/*/transactions/pending
- /v2/deltas/*, /v2/deltas/*/txn/group, /v2/deltas/txn/group/*

Also fixed AvmChainSpecific settings validator: use GET#/genesis (root)
instead of the non-existent GET#/v2/genesis.

Added regression test asserting the spurious paths are NOT callable.

https://claude.ai/code/session_01TZ64DZis9YaJSU3oMwtRLe

* fetch real AVM block data via chained api.read

parseBlock now uses the ChainReader passed through AbstractPollChainSpecific
to fetch GET#/v2/blocks/{lastRound}?header-only=true after /v2/status,
so BlockContainer.timestamp comes from block.ts and hash/parentHash
decode from block.seed/block.prev (base64 -> 32 raw bytes) instead of
being synthesized from the round number.

Also differentiate quorum per method in DefaultAvmMethods: single-
resource lookups (/v2/blocks/{round}, /v2/accounts/{addr}, etc.) now
use NotNullQuorum so a single replica returning empty/404 doesn't
shadow a valid response from another upstream. List and status
endpoints keep AlwaysQuorum; send endpoints keep BroadcastQuorum.

https://claude.ai/code/session_01TZ64DZis9YaJSU3oMwtRLe

* Update submodules

* Update chains

* Fix settings validation

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-23 13:10:56 +02:00
Vadim Filin
aa40578664 Add safe error parsing for REST HTTP responses (#812)
* fix(rest): handle non-JSON error bodies on non-200 HTTP responses

When a REST upstream (e.g. TON) returns a non-200 status with a plain-text
body such as "Service Unavailable" but advertises application/json as the
content-type, the error parser would throw JsonParseException
("Unrecognized token 'Service'"), which bubbled up as a generic -32005
ChainException and obscured the real cause.

Catch JsonParseException/IOException around readError and fall back to a
"HTTP Code: X" ChainCallError (CODE_UPSTREAM_INVALID_RESPONSE), matching
the behavior already implemented in JsonRpcHttpReader. Also return the
fallback when readError returns null.

* fix(rest): close parser, log stack traces, fall back on empty errors

Address PR review feedback:
- Close the Jackson JsonParser via `use { ... }` to release buffers.
- Switch to parameterized SLF4J logging and pass the exception so stack
  traces are preserved on parsing/IO failures.
- Treat a parsed error with code=0 and blank message (e.g. from a bare
  `{}` body) as no useful error info and fall back to the generic
  HTTP-status error so the upstream status isn't silently dropped.

* fix(rest): short-circuit HTTP 503 without JSON parsing

Narrow the fix to exactly the case reported: HTTP 503 Service Unavailable
responses (typically from Cloudflare) carry a plain-text or HTML body but
can be served with Content-Type: application/json, so attempting to parse
the body as JSON raises JsonParseException and surfaces as a confusing
-32005 "Unrecognized token 'Service'" error.

For status 503, skip parsing entirely and return a ChainCallError
directly. All other non-200 responses keep the existing behavior.

* docs(rest): align 503 branch comment with error code

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-21 18:24:33 +02:00
a10zn8
25dbc7c388 response signing with auth key (#811)
* docs: spec for unifying response signing with auth key

Design для замены отдельной SignatureConfig на подпись ответов
RSA-ключом, взятым из auth.server.provider-private-key.

Made-with: Cursor

* docs: implementation plan for auth-based response signing

План реализации по спеке 2026-04-20-response-signing-with-auth-key-design.md.
Разбит на 9 задач: новые RsaSigner/DisabledSigner по TDD, переработка фабрики
под AuthorizationConfig, удаление SignatureConfig/signed-response, снятие
cache-гейта в EthereumLocalReader, обновление документации.

Made-with: Cursor

* feat(signature): add RsaSigner using SHA256withRSA

Made-with: Cursor

* feat(signature): add DisabledSigner that throws on sign()

Made-with: Cursor

* refactor(signature): ResponseSigner.sign returns non-null Signature

Made-with: Cursor

* refactor(signature): build signer from AuthorizationConfig

Made-with: Cursor

* refactor(config): remove signed-response YAML section and SignatureConfig

Made-with: Cursor

* refactor(signature): remove EcdsaSigner and NoSigner

Remove the obsolete ECDSA signer and the transitional NoSigner stub.
Replace NoSigner usages in tests with DisabledSigner, and pass
DisabledSigner to BroadcastReader in tests (signer is now non-null).

Made-with: Cursor

* refactor(local-reader): serve cached results for requests with nonce

Made-with: Cursor

* docs: replace signed-response with auth section incl. response signing

Made-with: Cursor

* docs: correct auth section YAML and expand Response Signing note

- docs/reference-configuration.adoc: fix the YAML shape of the auth
  section (server.keys.{provider-private-key,external-public-key} and
  publicKeyOwner) to match AuthorizationConfigReader, and expand the
  Response Signing subsection with the actual signed-message format.
- .gitignore: ignore /demo/response-signing/ (local sandbox with keys
  and generated gRPC stubs — regenerate with generate-keys.sh + protoc)
  and /docs/superpowers/ (specs/plans kept local-only for now). Any
  previously tracked files under these paths are untracked here.

Made-with: Cursor

* feat(upstream): auto-inject secure-signed label when signing is enabled

Expose ResponseSigner.enabled and thread the bean through UpstreamCreator
so Generic/Ethereum/Bitcoin creators can enrich each upstream's labels
with secure-signed=true whenever auth-backed response signing is active.
A user-provided value for the label is preserved.

Made-with: Cursor
2026-04-21 10:33:37 +03:00
msizov
e8232231df add lower bound cronos (#810) 2026-04-16 18:20:46 +05:00
msizov
f38bc660c3 update public repo (#809) 2026-04-16 17:26:15 +05:00
KirillPamPam
2432e2567c Fix sol head detection (#808) 2026-04-07 12:14:18 +04:00
KirillPamPam
93b8ad0aeb Fix aztec (#807) 2026-03-31 18:25:22 +04:00
Anton
cbf6ae9723 fix(beacon): forward Content-Type header from upstream responses (#806)
Add Content-Type to the beacon chain response headers whitelist.
Without this, REST endpoints returning SSZ binary data (e.g.
/eth/v2/debug/beacon/states) are mislabeled as application/json
by dproxy, breaking client-side parsing.

Companion fix: drpcorg/dproxy#2348
2026-03-20 11:02:18 +03:00
Anton
56f6bb3a7b Add Robinhood and TAC Chains (#804)
* add Robinhood Chain testnet support

Update emerald-grpc submodule with CHAIN_ROBINHOOD__TESTNET = 10190.

* update submodules to include TAC chain merge

Sync emerald-grpc and public submodules to latest.
2026-03-17 19:31:18 +03:00
msizov
d259c3933a update polygon's chains.yaml entry (#803) 2026-03-17 15:41:18 +05:00
Vadim Filin
9a72a3232c Introduce Morph chain (#802)
* Introduce Morph chain

* Temp bind app type to ETHEREUM
2026-03-13 16:00:52 +01:00
KirillPamPam
b9d0a8c60c New sei errors (#799) 2026-03-03 12:54:53 +04:00
KirillPamPam
fc85b68175 New pub (#798) 2026-03-02 17:43:47 +04:00
KirillPamPam
7d73099e72 New pub (#797) 2026-02-26 17:39:00 +04:00
KirillPamPam
1dc553527f New prune err (#796) 2026-02-26 16:46:55 +04:00
KirillPamPam
9108f89eee Use external prom server (#793) 2026-02-18 17:04:17 +04:00
Anton
15047c7d26 Fix Flux.merge() concurrency limit in SubscribeChainStatus (#792) 2026-02-06 15:41:04 +03:00
Anton
b375fd34b4 Update saigon chain id (#791) 2026-02-06 00:15:11 +03:00
Vadim Filin
ee72ca37be Update saigon chain id (#790) 2026-02-06 00:10:48 +03:00
Anton
1c4b0e93d2 feat: add Moca mainnet and testnet chain (#789) 2026-02-05 16:17:59 +03:00
KirillPamPam
9b5e7ca54e Timeouts for http server (#788) 2026-02-04 16:01:25 +04:00
a10zn8
1b12d83066 update proto (#787) 2026-02-01 14:01:02 +03:00
Artem Rootman
21d36f07af update chains.yaml (#786) 2026-01-30 19:20:42 +03:00
Artem Rootman
4d4a2ed655 add aztec networks (#785)
* add aztec networks

* fix linter errors & checkout from main (public)

* fix AztecLowerBoundService
2026-01-30 19:04:05 +03:00
Vadim Filin
116807054a Add tempo support (#784) 2026-01-29 21:12:40 +07:00
Vadim Filin
28108a11db Update grpc (#783) 2026-01-29 12:34:31 +07:00
Vadim Filin
5b4e8884ba Handle 429 error (#782) 2026-01-28 18:06:14 +07:00
KirillPamPam
3b5940cc20 Integrate rx/receipts gold bounds (#781) 2026-01-28 12:54:50 +04:00
Artem Rootman
2e4c99b202 Fix Hyperliquid native tx detection on testnet (#780) 2026-01-26 13:41:56 +05:00
KirillPamPam
f3ecbdaaa7 Lower bounds fixes (#777) 2026-01-23 14:33:45 +04:00
KirillPamPam
897d98dfb1 MegaETH support (#779) 2026-01-23 13:49:58 +04:00
msizov
40fdabe790 add tempo moderato testnet (#778) 2026-01-21 16:31:22 +05:00
EugeneDrpc
01c51a6f06 blob detector npe fix, other detectors fix 404 scenario (#776)
* blob detector npe fix, other detectors fix 404 scenario

* Fix flaky GenericRpcHeadTest scheduler
2026-01-20 11:55:38 +01:00
Anton
cd57300751 Solana Head Detection: slotSubscribe (#772)
* Implement Solana head detection strategies with metrics tracking and testing

* Add benchmark tests for Solana BlockSubscribe and SlotSubscribe strategies

* Implement metrics logging and strategy configuration for Solana head detection

* Add metrics logging and comparison for SLOT_SUBSCRIBE strategy

* Refactor SolanaChainSpecificTest: Consolidate tests for slotSubscribe strategy, remove BlockSubscribe tests, and enhance caching logic. Delete SolanaStrategyBenchmark for performance comparison.

* add synthetic parentHash, improve tests

* Fix linter

* Optimize Solana getLatestBlock to use single getEpochInfo call
Replace two separate RPC calls (getSlot + getBlockHeight) with a single getEpochInfo call that returns both absoluteSlot and blockHeight

* Enhance height estimation logic in SolanaChainSpecific: Implement optimistic height estimation and improve error handling for RPC failures. Update tests to validate new behavior.

* Refactor height verification in SolanaChainSpecific: Replace getBlockHeight with getEpochInfo for improved efficiency and accuracy in height estimation. Update logic to handle actual slot and height retrieval.
2026-01-19 11:25:16 +03:00
KirillPamPam
d61eda2a6b New state error (#775) 2026-01-16 16:55:54 +04:00
Anton
236f560f2a Support “network” field of compatible clients config bans (#774) 2026-01-15 12:25:29 +03:00
KirillPamPam
be77e4caeb Fid monad gas detection (#771) 2026-01-15 13:15:59 +04:00
EugeneDrpc
7f9e350a9c add more logs to doge upstream (#773)
* add more logs to doge upstream

* fix other similar cases
2026-01-14 17:09:34 +01:00
Anton
a5320bd9e5 Add WebSocket subscription support for Ripple and migrate to ledger_closed (#770)
* Add WebSocket subscription support for Ripple and migrate to ledger_closed

  - Replace deprecated `ledger` RPC method with `ledger_closed` for polling
  - Add WebSocket subscription support for Ripple ledger stream
  - Add RippleCommandParams for native Ripple WS command format (uses "command" instead of "method")
  - Extend ResponseWSParser to handle Ripple subscription format (type: "ledgerClosed")
  - Update WsSubscriptionsImpl to extract stream type for Ripple subscriptions
  - Implement getFromHeader() for parsing ledgerClosed WS events
  - Add RippleLedgerStreamEvent data class for WS subscription events
  - Add unit tests for ResponseWSParser and RippleChainSpecific

* Remove legacy format
2026-01-14 13:49:34 +03:00
KirillPamPam
4a9de83815 New chains (#769) 2026-01-08 17:42:29 +04:00
KirillPamPam
8dec46fb27 New btc methods (#768) 2026-01-07 12:46:00 +04:00
KirillPamPam
536c663b2a Update dependencies (#767) 2026-01-06 16:32:03 +04:00
Artem Rootman
c5e1436462 make version range inclusive in selector (#766) 2025-12-30 04:33:27 +04:00
KirillPamPam
6193499d58 Fix ripple tx broadcast (#765) 2025-12-24 14:24:08 +04:00
Anton
9d4f4a185e add tempo tesnet and update xlayer testnet (#764) 2025-12-24 11:59:13 +03:00
KirillPamPam
d76ab32624 Pass an error as is (#763) 2025-12-23 13:59:01 +04:00
Vyacheslav
b944aa8ac6 add custom headers as upstream settings (#761)
* add custom headers

* add docs
2025-12-18 20:19:02 +02:00
Vadim Filin
3e845bcdf0 Support '<' and '>' operations for client routing on key (#755) 2025-12-18 16:01:37 +04:00