feat(bridge): Arch Network destination for Spectra#18
Draft
EvgenyNasretdinov wants to merge 21 commits into
Draft
feat(bridge): Arch Network destination for Spectra#18EvgenyNasretdinov wants to merge 21 commits into
EvgenyNasretdinov wants to merge 21 commits into
Conversation
- Add ChainConfig.Kind, ContractConfig.FeeHookProgramID, DestinationMethodConfig.Kind yaml fields to config structs (empty/"evm" preserves existing behaviour) - Add buildDestination factory (unexported) switching on chain.Kind; Arch path calls newArchDestinationFromConfig; EVM path delegates to NewWriteClient - Add BuildDestinationForTest exported thin wrapper for archtest package use - Update NewBridge construction loop: Arch chains routed through buildDestination, EVM chains keep existing NewWriteClient path with full contract slice - Fix Task-9 forward concern: TransactionHandler.Process short-circuits for arch destinations, calling dest.Send directly (TODO(task-13) for DB/metrics) - Add factory_test.go in archtest: ArchKind, MissingSigner, MissingFeeHook
…tion histogram, poller symmetry, single-contract guard)
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
Adds Arch Network as a destination chain for the Spectra bridge, alongside the existing EVM destinations. The bridge node can now publish DIA oracle intents to an Arch program (
PushOracleReceiverV2Rust port) by callingHandleIntentUpdate, pay the per-call protocol fee, observeDIA_ORACLE.*program logs for rejections/staleness, and surface metrics + health for the new path.Implementation is gated by
chain.kindin the chain config (evmkeeps current behavior;archactivates the new path), so existing deployments are unaffected.What's in the branch
services/bridge/internal/arch/— self-contained Arch client: Borsh codec forOracleIntent, PDA derivation with the Solana off-curve check, BIP-340 Schnorr signer (btcec/v2/schnorr), JSON-RPC client (get_account_info,send_transaction,get_processed_transaction, block helpers),HandleIntentUpdateinstruction encoder,DIA_ORACLE.*log parser (update/stale/rejected).services/bridge/internal/bridge/—Destinationinterface,EvmWriteClientadapter (no rename of existing code), newArchWriteClient,chain.Kinddiscriminator +buildDestinationfactory, background poller forfee_vault/ payer balance gauges,arch_logsJSONB column anddia_arch_rejectionsrow write inTransactionHandler.services/bridge/test/integration/arch_test.go) verified end-to-end against a local Arch v0.6.5 validator with the deployed receiver + fee-hook programs.services/bridge/docs/ARCH_DESTINATION.mdrunbook,config/examples/arch-testnet.*.yamlconfig samples, README section.Known deferred items (TODOs in code, not blockers)
processed_events.statuscolumn is referenced but the schema column itself is added on a different branch (cross-team gap).arch_logsJSONB write is wired but the lookup that decides which event row to attach to is still TODO.eventID = 0(FK is NULL) since rejected intents have no upstream event yet.Why draft
The branch is implementation-complete and tests pass, but it's opened in draft so DIA can review the discriminator/factory shape and the schema additions before we mark it ready. Happy to rebase / split commits if a different structure is preferred.
Test plan
go test ./services/bridge/...passes (unit tests, mock write-client tests)