Compare commits

...

5 Commits

Author SHA1 Message Date
Konstantin Akimov
f1cac078cb
Merge a4256c9261 into ad7a373529 2024-12-19 22:22:52 +00:00
pasta
ad7a373529
Merge #6498: docs: fixes for Release Notes v22.0.0 and v21.0.0
Some checks failed
Label Merge Conflicts / main (push) Failing after 11s
Guix Build / build-image (push) Failing after 1m30s
Guix Build / build (aarch64-linux-gnu) (push) Has been skipped
Guix Build / build (arm-linux-gnueabihf) (push) Has been skipped
Guix Build / build (arm64-apple-darwin) (push) Has been skipped
Guix Build / build (powerpc64-linux-gnu) (push) Has been skipped
Guix Build / build (riscv64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-apple-darwin) (push) Has been skipped
Guix Build / build (x86_64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-w64-mingw32) (push) Has been skipped
Check Merge Fast-Forward Only / check_merge (push) Successful in 1m21s
CI / Build Image (push) Failing after 2m3s
CI / Build Dependencies (arm-linux, arm-linux-gnueabihf) (push) Has been skipped
CI / Build Dependencies (linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (arm-linux, arm-linux, arm-linux-gnueabihf) (push) Has been skipped
CI / Build (linux64, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_cxx20, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_fuzz, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_nowallet, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_sqlite, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_tsan, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_ubsan, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
d75ee3a9e1 docs: fixes for Release Notes v22.0.0 and v21.0.0 (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  I noticed that we announced in current release new RPC `quorum platformsign` which has been actually released with v21.
  Though, in release notes for v21 it has a wrong name.

  ## What was done?
  Removed `quorum platformsign` from v22 release notes; fixed name in v21.
  Also mentioned build for Freebsd and minor typo `s/MN_R/MN_RR/` with name of forks on regtest.

  ## How Has This Been Tested?
  N/A

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK d75ee3a9e1

Tree-SHA512: 2d2309e81607c25a512577c96f15ee36b04b585c5751dc1500f2b432d90fc19e70f1b72cf1f7bf843abf854b7869481765902c7c61e9ea7e21b087a126c49a99
2024-12-19 16:22:31 -06:00
Konstantin Akimov
d75ee3a9e1
docs: fixes for Release Notes v22.0.0 and v21.0.0
platformsign has been released in v21 and name there is wrong: platformsign vs signplatform
2024-12-19 21:22:09 +07:00
Konstantin Akimov
a4256c9261
feat: implement new RPC getrawbestchainlock 2024-12-07 00:32:28 +07:00
Konstantin Akimov
085b5fd00d
feat: implement new rpc getrawislock 2024-12-07 00:32:09 +07:00
6 changed files with 97 additions and 5 deletions

View File

@ -86,10 +86,10 @@ likely require a reindex.
- **glibc Requirement**
- The minimum required glibc to run Dash Core is now **2.31**. This means that **RHEL 8** and **Ubuntu 18.04 (Bionic)** are no longer supported.
## New RPCs
- **FreeBSD Improvements**
- Fixed issues with building Dash Core on FreeBSD.
- **`quorum platformsign`**
- A new subcommand has been introduced, offering a structured way to perform platform-related quorum signing operations.
## New RPCs
- **`coinjoinsalt`**
- Allows manipulation of a CoinJoin salt stored in a wallet.
@ -153,7 +153,7 @@ likely require a reindex.
## Devnet Breaking Changes
- **Hardfork Activation Changes**
- `BRR` (`realloc`), `DIP0020`, `DIP0024`, `V19`, `V20`, and `MN_R` hardforks are now activated at **block 2** instead of block **300** on devnets.
- `BRR` (`realloc`), `DIP0020`, `DIP0024`, `V19`, `V20`, and `MN_RR` hardforks are now activated at **block 2** instead of block **300** on devnets.
- **Implications:**
- Breaking change.
- Inability to sync on devnets created with earlier Dash Core versions and vice versa.

View File

@ -235,7 +235,7 @@ Remote Procedure Calls (RPCs)
support for coin selection and a custom fee rate. The `send` RPC is experimental
and may change in subsequent releases. Using it is encouraged once it's no
longer experimental: `sendmany` and `sendtoaddress` may be deprecated in a future release.
- A new `quorum signplatform` RPC is added for Platform needs. This composite command limits Platform to only request signatures from the Platform quorum type. It is equivalent to `quorum sign <platform type>`.
- A new `quorum platformsign` RPC is added for Platform needs. This composite command limits Platform to only request signatures from the Platform quorum type. It is equivalent to `quorum sign <platform type>`.
### RPC changes
- `createwallet` has an updated argument list: `createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup )`

View File

@ -275,6 +275,37 @@ static RPCHelpMan getbestchainlock()
};
}
static RPCHelpMan getrawbestchainlock()
{
return RPCHelpMan{"getrawbestchainlock",
"\nReturns the raw best ChainLock. Throws an error if there is no known ChainLock yet.",
{},
RPCResult{
RPCResult::Type::STR, "data", "The serialized, hex-encoded data for best ChainLock"
},
RPCExamples{
HelpExampleCli("getrawbestchainlock", "")
+ HelpExampleRpc("getrawbestchainlock", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
UniValue result(UniValue::VOBJ);
const NodeContext& node = EnsureAnyNodeContext(request.context);
LLMQContext& llmq_ctx = EnsureLLMQContext(node);
llmq::CChainLockSig clsig = llmq_ctx.clhandler->GetBestChainLock();
if (clsig.IsNull()) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Unable to find any ChainLock");
}
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << clsig;
return HexStr(ssTx);
},
};
}
void RPCNotifyBlockChange(const CBlockIndex* pindex)
{
if(pindex) {
@ -3106,6 +3137,7 @@ static const CRPCCommand commands[] =
{ "blockchain", &getblockstats, },
{ "blockchain", &getbestblockhash, },
{ "blockchain", &getbestchainlock, },
{ "blockchain", &getrawbestchainlock, },
{ "blockchain", &getblockcount, },
{ "blockchain", &getblock, },
{ "blockchain", &getblockfrompeer, },

View File

@ -115,6 +115,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "gettransaction", 1, "include_watchonly" },
{ "gettransaction", 2, "verbose" },
{ "getrawtransaction", 1, "verbose" },
{ "getrawislocks", 0, "txids" },
{ "getrawtransactionmulti", 0, "transactions" },
{ "getrawtransactionmulti", 1, "verbose" },
{ "gettxchainlocks", 0, "txids" },

View File

@ -300,6 +300,7 @@ static RPCHelpMan getrawtransactionmulti() {
{"verbose", RPCArg::Type::BOOL, RPCArg::Default{false},
"If false, return a string, otherwise return a json object"},
},
// TODO: replace RPCResults to proper annotation
RPCResults{},
RPCExamples{
HelpExampleCli("getrawtransactionmulti",
@ -366,6 +367,60 @@ static RPCHelpMan getrawtransactionmulti() {
};
}
static RPCHelpMan getrawislocks()
{
return RPCHelpMan{"getrawislocks",
"\nReturns the raw InstantSend lock data for each txids. Returns Null if there is no known IS yet.",
{
{"txids", RPCArg::Type::ARR, RPCArg::Optional::NO, "The transaction ids (no more than 100)",
{
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "A transaction hash"},
},
},
},
RPCResult{
RPCResult::Type::ARR, "", "Response is an array with the same size as the input txids",
{
RPCResult{"if InstantSend Lock is known for specified txid",
RPCResult::Type::STR, "data", "The serialized, hex-encoded data for 'txid'"
},
RPCResult{"if no InstantSend Lock is known for specified txid",
RPCResult::Type::STR, "data", "Just 'None' string"
},
}},
RPCExamples{
HelpExampleCli("getrawislocks", "'[\"txid\",...]'")
+ HelpExampleRpc("getrawislocks", "'[\"txid\",...]'")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const NodeContext& node = EnsureAnyNodeContext(request.context);
UniValue result_arr(UniValue::VARR);
UniValue txids = request.params[0].get_array();
if (txids.size() > 100) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Up to 100 txids only");
}
for (const auto idx : irange::range(txids.size())) {
const uint256 txid(ParseHashV(txids[idx], "txid"));
LLMQContext& llmq_ctx = EnsureLLMQContext(node);
llmq::CInstantSendLockPtr islock = llmq_ctx.isman->GetInstantSendLockByTxid(txid);
if (islock == nullptr) {
result_arr.push_back("None");
} else {
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << *islock;
result_arr.push_back(HexStr(ssTx));
}
}
return result_arr;
},
};
}
static RPCHelpMan gettxchainlocks()
{
return RPCHelpMan{
@ -2082,6 +2137,7 @@ static const CRPCCommand commands[] =
{ "rawtransactions", &getassetunlockstatuses, },
{ "rawtransactions", &getrawtransaction, },
{ "rawtransactions", &getrawtransactionmulti, },
{ "rawtransactions", &getrawislocks, },
{ "rawtransactions", &gettxchainlocks, },
{ "rawtransactions", &createrawtransaction, },
{ "rawtransactions", &decoderawtransaction, },

View File

@ -263,6 +263,7 @@ class DashZMQTest (DashTestFramework):
assert_equal(uint256_to_string(zmq_chain_lock.blockHash), rpc_chain_lock_hash)
assert_equal(zmq_chain_locked_block.hash, rpc_chain_lock_hash)
assert_equal(zmq_chain_lock.sig.hex(), rpc_best_chain_lock_sig)
assert_equal(zmq_chain_lock.serialize().hex(), self.nodes[0].getrawbestchainlock())
# Unsubscribe from ChainLock messages
self.unsubscribe(chain_lock_publishers)
@ -285,6 +286,7 @@ class DashZMQTest (DashTestFramework):
# Create two raw TXs, they will conflict with each other
rpc_raw_tx_1 = self.create_raw_tx(self.nodes[0], self.nodes[0], 1, 1, 100)
rpc_raw_tx_2 = self.create_raw_tx(self.nodes[0], self.nodes[0], 1, 1, 100)
assert_equal([None], self.nodes[0].getrawislocks([rpc_raw_tx_1['txid']]))
# Send the first transaction and wait for the InstantLock
rpc_raw_tx_1_hash = self.nodes[0].sendrawtransaction(rpc_raw_tx_1['hex'])
self.wait_for_instantlock(rpc_raw_tx_1_hash, self.nodes[0])
@ -304,6 +306,7 @@ class DashZMQTest (DashTestFramework):
assert_equal(zmq_tx_lock_tx.hash, rpc_raw_tx_1['txid'])
zmq_tx_lock = msg_isdlock()
zmq_tx_lock.deserialize(zmq_tx_lock_sig_stream)
assert_equal([zmq_tx_lock.serialize().hex()], self.nodes[0].getrawislocks([rpc_raw_tx_1['txid']]))
assert_equal(uint256_to_string(zmq_tx_lock.txid), rpc_raw_tx_1['txid'])
# Try to send the second transaction. This must throw an RPC error because it conflicts with rpc_raw_tx_1
# which already got the InstantSend lock.