ravencoin: expose Core backend capability - #3
Open
ALENOC wants to merge 1 commit into
Open
Conversation
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
This adds an optional, Ravencoin-only
server.ravencoin_backendRPC so Ravencoin Electrum clients can determine which Ravencoin Core daemon is actually behind an ElectrumX server.The change is intentionally isolated and does not require a separate ElectrumX installation or process. It is designed for the existing multi-coin deployment model.
The implementation was prepared against
cipig/electrumxmaster commitc9dc2e138888da08843414b2072c40901f20032d.Why
After the recent Ravencoin consensus incident, an Electrum client should not infer backend safety merely from the fact that an ElectrumX server is reachable.
A client needs a way to inspect sanitized evidence about the configured
ravend, including the Core version. In particular, Ravencoin Core encodes 4.8.0 as numeric version4080000, which needs Ravencoin-specific parsing rather than the generic Bitcoin version-number interpretation.This RPC is the interoperability capability used by Electrum-Ravencoin. The server reports evidence; the client remains responsible for applying its own trust/safety policy.
What changes
For
COIN=Ravencoinonly, the environment installs small Ravencoin-specific subclasses:RavencoinDaemon, extending the existing daemon adapter;RavencoinElectrumX, extending the existing session class;server.ravencoin_backendreports only sanitized public information:nHeightvalidation capability;The daemon information is cached briefly to avoid creating unnecessary load on
ravend.Backward compatibility
Backward compatibility with existing and older Electrum clients is a hard requirement of this change.
This PR does not:
PROTOCOL_MIN;server.version;RavencoinElectrumX.set_request_handlers()first calls the existingElectrumX.set_request_handlers(ptuple)and only then addsserver.ravencoin_backend.Therefore an older client continues to use exactly the handlers selected by the existing Electrum protocol version negotiation. A client that does not know
server.ravencoin_backendsimply never calls it.The tests explicitly exercise representative protocol tuples
(1, 0),(1, 4, 2),(1, 6)and(1, 7)and verify that inherited handlers are preserved.Other coins are unaffected
The extension is activated only when the selected coin class has
NAME == "Ravencoin".BTC, LTC, ZEC and the other coins served by the same ElectrumX codebase continue to use their existing
DAEMON,SESSIONCLS, protocol handlers and configuration unchanged.This is important for the multi-coin architecture: no second ElectrumX install is required.
Requested deployment on all three Cipig RVN servers
Merging the code is only the first part of this request. Please also deploy the updated ElectrumX code to all three public Cipig Ravencoin endpoints:
electrum1.cipig.net— SSL20051, TCP10051electrum2.cipig.net— SSL20051, TCP10051electrum3.cipig.net— SSL20051, TCP10051The goal is for
server.ravencoin_backendto be available and return truthful live evidence from theravendactually used by each of the three servers.After deployment, each endpoint should be independently checked. The feature should not be considered operational until all three servers answer
server.ravencoin_backendsuccessfully and report their real Ravencoin Core backend.This matters because these three endpoints are already present in Electrum-Ravencoin discovery as discovery-only servers. They can only become independently verifiable by the hardened client once the capability is live on the actual public servers.
If the three servers share the same ElectrumX installation/code tree, a single code update is of course fine; the important requirement is that the updated service is restarted/reloaded for all three RVN endpoints and that the RPC is live on each of them.
Ravencoin safety evidence
The implementation includes the Ravencoin-specific evidence expected by current Electrum-Ravencoin clients:
4.8.0;4,487,775;nHeightvalidation from height4,487,776;These are evidence fields, not a replacement for client-side validation.
Core build identity
Core identity is deliberately not hard-coded.
The operator can configure:
RAVENCOIN_SOURCE_REPOSITORYRAVENCOIN_SOURCE_TAGRAVENCOIN_SOURCE_COMMITRAVENCOIN_ARTIFACT_SHA256RAVENCOIN_IDENTITY_EVIDENCEThis prevents the server from claiming to run a certified build unless that is actually how the deployment was built/configured.
If only the daemon's version is known, the response truthfully falls back to
VERSION_ONLYevidence. A client can then decide whether that is sufficient under its own policy.Tests
The added tests cover:
4080000->4.8.0);nHeightenforcement;The repository's existing pull-request CI additionally runs the full pytest suite, pycodestyle and documentation build.
Acceptance criteria
server.ravencoin_backendis verified live on each of the three endpoints.ravend.Scope
The final diff is intentionally small and self-contained: one Ravencoin backend module, one RVN-only activation block in the environment, and focused tests. No generic Electrum protocol implementation has been replaced.