Skip to content

reporter: sign via SignTx allowlist instead of blind SignRaw - #36

Merged
0xSpuddy merged 9 commits into
tellor-io:mainfrom
cryptoriums:feat/reporter-mtls-broadcast
Jul 9, 2026
Merged

reporter: sign via SignTx allowlist instead of blind SignRaw#36
0xSpuddy merged 9 commits into
tellor-io:mainfrom
cryptoriums:feat/reporter-mtls-broadcast

Conversation

@diorwave

Copy link
Copy Markdown
Contributor
  • Reporter daemon now signs through the signer's SignTx (msg-type allowlist), not blind SignRaw.
  • One-shot operator cmds (create-validator/-reporter/unjail) unchanged.
  • Regenerated vendor-api (SignTx + SignBridgeCheckpoint + SignOracleAttestation).
  • Added cmd/edit-validator for commission edits via the remote signer.

Comment thread reporter/client/client.go Outdated
Comment thread reporter/client/client.go
Comment on lines +940 to +946
// Close remote signer connection if used
if c.remoteSignerConn != nil {
if err := c.remoteSignerConn.Close(); err != nil {
c.logger.Error("Failed to close remote signer connection", "error", err)
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use defer next to where it is initialized

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this conn lives the whole daemon lifetime, keyring signs every tx via it until Stop()
defer-at-init would close it before signing, so it's deferred only on the error paths in newKeyringFromRemoteSigner.

Comment thread cmd/create-reporter/main.go Outdated
Comment thread Dockerfile Outdated
@0xSpuddy

Copy link
Copy Markdown
Contributor

@krasi-georgiev looks good after merge conflicts and fixed.

…wlist + setupKeyring, add event-driven rpcClient
@0xSpuddy
0xSpuddy self-requested a review July 7, 2026 17:45
0xSpuddy
0xSpuddy previously approved these changes Jul 7, 2026

@0xSpuddy 0xSpuddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and working to me, but could use strict checks for working rpc endpoint and chain-id.

@krasi-georgiev

Copy link
Copy Markdown
Contributor

Looks good and working to me, but could use strict checks for working rpc endpoint and chain-id.

@0xSpuddy what kind of strict checks? We can add them in this PR

}

var firstAccepted *sdk.TxResponse
var lastErr error

@0xSpuddy 0xSpuddy Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this would return as soon as any endpoint accepts the tx, instead of waiting for every broadcast goroutine to finish. Otherwise one slow or hung RPC can block the caller even after the tx has already been accepted elsewhere.

-	var firstAccepted *sdk.TxResponse
 	var lastErr error
 	for i := 0; i < len(clients); i++ {
 		r := <-results
 		case r.resp != nil && (r.resp.Code == 0 || isAlreadyBroadcastCode(r.resp)):
 			c.logger.Debug("Tx accepted by RPC endpoint", "endpoint", r.endpoint, "code", r.resp.Code, "txhash", r.resp.TxHash)
-			if firstAccepted == nil {
-				firstAccepted = r.resp
-			}
+			return r.resp, nil
-	if firstAccepted != nil {
-		return firstAccepted, nil
-	}
 	if lastErr != nil {

@0xSpuddy 0xSpuddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it looks good to you it's lgtm.

Comment thread reporter/client/client.go
// keep the chain ID already detected from the node endpoints.
if signerChainID != "" {
if signerChainID != chainId {
c.logger.Info("Using chain ID from remote signer", "signer_chain_id", signerChainID, "detected_chain_id", chainId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest erroring out the daemon if chain-id doesn't match with something like:

			return fmt.Errorf("remote signer chain ID %q does not match detected RPC chain ID %q", signerChainID, chainId)

@0xSpuddy
0xSpuddy merged commit 13b9ce9 into tellor-io:main Jul 9, 2026
2 checks passed
@krasi-georgiev
krasi-georgiev deleted the feat/reporter-mtls-broadcast branch July 11, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants