-
Notifications
You must be signed in to change notification settings - Fork 132
[group key addrs 1/?]: add new authmailbox RPC server and client #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
To allow re-starting a server with a given listen address, we refactor some of the code to export a new function to do just that.
TxProof is a struct that holds all components to prove a claimed outpoint exists in a given block.
Pull Request Test Coverage Report for Build 14776884033Details
💛 - Coveralls |
service Mailbox { | ||
/* | ||
Sends a single message to a receiver's mailbox. Requires a valid, unused | ||
Bitcoin transaction outpoint as proof of work/stake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/stake
/* | ||
A simple ping-pong RPC to check the server's health and connectivity. | ||
*/ | ||
rpc Ping (PingRequest) returns (PingResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe consider just calling this GetInfo
. I think we have that elsewhere.
package rpcutils | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"io" | ||
|
||
"github.com/btcsuite/btcd/chaincfg/chainhash" | ||
"github.com/btcsuite/btcd/wire" | ||
"github.com/lightninglabs/taproot-assets/proof" | ||
mboxrpc "github.com/lightninglabs/taproot-assets/taprpc/authmailboxrpc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think file name here should be more specific to authmailboxrpc
. IMO proof.go
is too general.
// TxProof is a struct that contains all the necessary elements to prove the | ||
// existence of a certain outpoint in a block. | ||
type TxProof struct { | ||
// MsgTx is the transaction that contains the outpoint. | ||
MsgTx wire.MsgTx | ||
|
||
// BlockHeader is the header of the block that contains the transaction. | ||
BlockHeader wire.BlockHeader | ||
|
||
// BlockHeight is the height at which the block was mined. | ||
BlockHeight uint32 | ||
|
||
// MerkleProof is the proof that the transaction is included in the | ||
// block and its merkle root. | ||
MerkleProof TxMerkleProof | ||
|
||
// ClaimedOutPoint is the outpoint that is being proved to exist in the | ||
// transaction. | ||
ClaimedOutPoint wire.OutPoint | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone can prove an outpoint in a block. The UTXO set is public. Any sender could use up all UTXOs.
Maybe I'm missing something, please see #874 (comment)
@guggero, remember to re-request review from reviewers when ready |
Implements the mailbox server and client as described here: #874 (comment)