Skip to content
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

Split MainchainService into ValidatorService and WalletService, update ValidatorService #5

Merged
merged 7 commits into from
Oct 10, 2024

Conversation

Ash-L2L
Copy link
Collaborator

@Ash-L2L Ash-L2L commented Oct 7, 2024

No description provided.

@Ash-L2L Ash-L2L changed the title Rename MainchainService -> ValidatorService, update ValidatorService Split MainchainService into ValidatorService and WalletService, update ValidatorService Oct 9, 2024
Comment on lines +28 to +29
rpc GenerateBlocks(GenerateBlocksRequest)
returns (GenerateBlocksResponse);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be axed. Generating blocks currently happens through the contrib/signet/miner script provided by Bitcoin Core, with minor tweaks by us. I'm currently working on a tweak here where we pass in CLI args for extra OP_RETURN messages that we want to add, which will let us do sidechain management. If we instead do generation through the wallet service, I think it'll end up being very hairy and complex

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is only for Regtest mode, so the signet script is irrelevant

Copy link
Contributor

Choose a reason for hiding this comment

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

So what I'm thinking for signet is:

  1. The validator exposes an endpoint for constructing the correct M{1-6} OP_RETURN messages
  2. The signet miner script takes in these OP_RETURN messages, adding them to the coinbase vouts

For mining on regtest, the signet miner script could be modified to remove the signet parts, but keep the rest. Sidechain management on signet needs to be implemented anyways, and we need not too-cumbersome ways of doing this on regtest as well. I.e. not re-implement the block construction logic.

The way bitcoin-cli does it with -generate does not work for us. Under the hood that defers to generatetoaddress, and there's no way of specifying coinbase outputs there.

@Ash-L2L Ash-L2L marked this pull request as draft October 9, 2024 14:15
@Ash-L2L Ash-L2L force-pushed the ash/proto branch 2 times, most recently from d2a3a92 to 788ef35 Compare October 9, 2024 14:21
@Ash-L2L Ash-L2L marked this pull request as ready for review October 9, 2024 14:25
@@ -233,8 +178,8 @@ message GetSidechainProposalsRequest {
message GetSidechainProposalsResponse {
message SidechainProposal {
uint32 sidechain_number = 1;
bytes data = 2;
bytes data_hash = 3;
google.protobuf.BytesValue data = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to decode this data into a meaningful message? I.e. version, title, description and the two hashes

https://github.com/bitcoin/bips/blob/master/bip-0300.mediawiki#m1----propose-sidechain

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.

2 participants