serai/coins/monero/tests/runner.rs

327 lines
10 KiB
Rust
Raw Normal View History

2022-12-14 14:27:49 +00:00
use core::ops::Deref;
use std_shims::{sync::OnceLock, collections::HashSet};
2022-12-14 14:27:49 +00:00
use zeroize::Zeroizing;
use rand_core::OsRng;
use curve25519_dalek::{constants::ED25519_BASEPOINT_TABLE, scalar::Scalar};
use tokio::sync::Mutex;
use monero_serai::{
2023-03-13 12:03:13 +00:00
random_scalar,
rpc::{HttpRpc, Rpc},
wallet::{
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
ViewPair, Scanner,
address::{Network, AddressType, AddressSpec, AddressMeta, MoneroAddress},
SpendableOutput, Fee,
},
transaction::Transaction,
DEFAULT_LOCK_WINDOW,
};
pub fn random_address() -> (Scalar, ViewPair, MoneroAddress) {
let spend = random_scalar(&mut OsRng);
2023-07-23 18:32:14 +00:00
let spend_pub = &spend * ED25519_BASEPOINT_TABLE;
2022-12-14 14:27:49 +00:00
let view = Zeroizing::new(random_scalar(&mut OsRng));
(
spend,
2022-12-14 14:27:49 +00:00
ViewPair::new(spend_pub, view.clone()),
MoneroAddress {
meta: AddressMeta::new(Network::Mainnet, AddressType::Standard),
spend: spend_pub,
2023-07-23 18:32:14 +00:00
view: view.deref() * ED25519_BASEPOINT_TABLE,
},
)
}
// TODO: Support transactions already on-chain
// TODO: Don't have a side effect of mining blocks more blocks than needed under race conditions
pub async fn mine_until_unlocked(rpc: &Rpc<HttpRpc>, addr: &str, tx_hash: [u8; 32]) {
// mine until tx is in a block
let mut height = rpc.get_height().await.unwrap();
let mut found = false;
while !found {
let block = rpc.get_block_by_number(height - 1).await.unwrap();
found = match block.txs.iter().find(|&&x| x == tx_hash) {
Some(_) => true,
None => {
height = rpc.generate_blocks(addr, 1).await.unwrap().1 + 1;
false
}
}
}
// Mine until tx's outputs are unlocked
let o_indexes: Vec<u64> = rpc.get_o_indexes(tx_hash).await.unwrap();
while rpc
.get_outs(&o_indexes)
.await
.unwrap()
.into_iter()
.all(|o| (!(o.unlocked && height >= (o.height + DEFAULT_LOCK_WINDOW))))
{
height = rpc.generate_blocks(addr, 1).await.unwrap().1 + 1;
}
}
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
// Mines 60 blocks and returns an unlocked miner TX output.
Initial In Instructions pallet and Serai client lib (#233) * Initial work on an In Inherents pallet * Add an event for when a batch is executed * Add a dummy provider for InInstructions * Add in-instructions to the node * Add the Serai runtime API to the processor * Move processor tests around * Build a subxt Client around Serai * Successfully get Batch events from Serai Renamed processor/substrate to processor/serai. * Much more robust InInstruction pallet * Implement the workaround from https://github.com/paritytech/subxt/issues/602 * Initial prototype of processor generated InInstructions * Correct PendingCoins data flow for InInstructions * Minor lint to in-instructions * Remove the global Serai connection for a partial re-impl * Correct ID handling of the processor test * Workaround the delay in the subscription * Make an unwrap an if let Some, remove old comments * Lint the processor toml * Rebase and update * Move substrate/in-instructions to substrate/in-instructions/pallet * Start an in-instructions primitives lib * Properly update processor to subxt 0.24 Also corrects failures from the rebase. * in-instructions cargo update * Implement IsFatalError * is_inherent -> true * Rename in-instructions crates and misc cleanup * Update documentation * cargo update * Misc update fixes * Replace height with block_number * Update processor src to latest subxt * Correct pipeline for InInstructions testing * Remove runtime::AccountId for serai_primitives::NativeAddress * Rewrite the in-instructions pallet Complete with respect to the currently written docs. Drops the custom serializer for just using SCALE. Makes slight tweaks as relevant. * Move instructions' InherentDataProvider to a client crate * Correct doc gen * Add serde to in-instructions-primitives * Add in-instructions-primitives to pallet * Heights -> BlockNumbers * Get batch pub test loop working * Update in instructions pallet terminology Removes the ambiguous Coin for Update. Removes pending/artificial latency for furture client work. Also moves to using serai_primitives::Coin. * Add a BlockNumber primitive * Belated cargo fmt * Further document why DifferentBatch isn't fatal * Correct processor sleeps * Remove metadata at compile time, add test framework for Serai nodes * Remove manual RPC client * Simplify update test * Improve re-exporting behavior of serai-runtime It now re-exports all pallets underneath it. * Add a function to get storage values to the Serai RPC * Update substrate/ to latest substrate * Create a dedicated crate for the Serai RPC * Remove unused dependencies in substrate/ * Remove unused dependencies in coins/ Out of scope for this branch, just minor and path of least resistance. * Use substrate/serai/client for the Serai RPC lib It's a bit out of place, since these client folders are intended for the node to access pallets and so on. This is for end-users to access Serai as a whole. In that sense, it made more sense as a top level folder, yet that also felt out of place. * Move InInstructions test to serai-client for now * Final cleanup * Update deny.toml * Cargo.lock update from merging develop * Update nightly Attempt to work around the current CI failure, which is a Rust ICE. We previously didn't upgrade due to clippy 10134, yet that's been reverted. * clippy * clippy * fmt * NativeAddress -> SeraiAddress * Sec fix on non-provided updates and doc fixes * Add Serai as a Coin Necessary in order to swap to Serai. * Add a BlockHash type, used for batch IDs * Remove origin from InInstruction Makes InInstructionTarget. Adds RefundableInInstruction with origin. * Document storage items in in-instructions * Rename serai/client/tests/serai.rs to updates.rs It only tested publishing updates and their successful acceptance.
2023-01-20 16:00:18 +00:00
#[allow(dead_code)]
pub async fn get_miner_tx_output(rpc: &Rpc<HttpRpc>, view: &ViewPair) -> SpendableOutput {
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
let mut scanner = Scanner::from_view(view.clone(), Some(HashSet::new()));
// Mine 60 blocks to unlock a miner TX
let start = rpc.get_height().await.unwrap();
rpc
.generate_blocks(&view.address(Network::Mainnet, AddressSpec::Standard).to_string(), 60)
.await
.unwrap();
let block = rpc.get_block_by_number(start).await.unwrap();
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
scanner.scan(rpc, &block).await.unwrap().swap_remove(0).ignore_timelock().swap_remove(0)
}
/// Make sure the weight and fee match the expected calculation.
pub fn check_weight_and_fee(tx: &Transaction, fee_rate: Fee) {
let fee = tx.rct_signatures.base.fee;
let weight = tx.weight();
let expected_weight = fee_rate.calculate_weight_from_fee(fee);
assert_eq!(weight, expected_weight);
let expected_fee = fee_rate.calculate_fee_from_weight(weight);
assert_eq!(fee, expected_fee);
}
pub async fn rpc() -> Rpc<HttpRpc> {
Redo Dockerfile generation (#530) Moves from concatted Dockerfiles to pseudo-templated Dockerfiles via a dedicated Rust program. Removes the unmaintained kubernetes, not because we shouldn't have/use it, but because it's unmaintained and needs to be reworked before it's present again. Replaces the compose with the work in the new orchestrator binary which spawns everything as expected. While this arguably re-invents the wheel, it correctly manages secrets and handles the variadic Dockerfiles. Also adds an unrelated patch for zstd and simplifies running services a bit by greater utilizing the existing infrastructure. --- * Delete all Dockerfile fragments, add new orchestator to generate Dockerfiles Enables greater templating. Also delete the unmaintained kubernetes folder *for now*. This should be restored in the future. * Use Dockerfiles from the orchestator * Ignore Dockerfiles in the git repo * Remove CI job to check Dockerfiles are as expected now that they're no longer committed * Remove old Dockerfiles from repo * Use Debian for monero-wallet-rpc * Remove replace_cmds for proper usage of entry-dev Consolidates ports a bit. Updates serai-docker-tests from "compose" to "build". * Only write a new dockerfile if it's distinct Preserves the updated time metadata. * Update serai-docker-tests * Correct the path Dockerfiles are built from * Correct inclusion of orchestration folder in Docker builds * Correct debug/release flagging in the cargo command Apparently, --debug isn't an effective NOP yet an error. * Correct path used to run the Serai node within a Dockerfile * Correct path in Monero Dockerfile * Attempt storing monerod in /usr/bin * Use sudo to move into /usr/bin in CI * Correct 18.3.0 to 18.3.1 * Escape * with quotes * Update deny.toml, ADD orchestration in runtime Dockerfile * Add --detach to the Monero GH CI * Diversify dockerfiles by network * Fixes to network-diversified orchestration * Bitcoin and Monero testnet scripts * Permissions and tweaks * Flatten scripts folders * Add missing folder specification to Monero Dockerfile * Have monero-wallet-rpc specify the monerod login * Have the Docker CMD specify env variables inserted at time of Dockerfile generation They're overrideable with the global enviornment as for tests. This enables variable generation in orchestrator and output to productionized Docker files without creating a life-long file within the Docker container. * Don't add Dockerfiles into Docker containers now that they have secrets Solely add the source code for them as needed to satisfy the workspace bounds. * Download arm64 Monero on arm64 * Ensure constant host architecture when reproducibly building the wasm Host architecture, for some reason, can effect the generated code despite the target architecture always being foreign to the host architecture. * Randomly generate infrastructure keys * Have orchestrator generate a key, be able to create/start containers * Ensure bash is used over sh * Clean dated docs * Change how quoting occurs * Standardize to sh * Have Docker test build the dev Dockerfiles * Only key_gen once * cargo update Adds a patch for zstd and reconciles the breaking nightly change which just occurred. * Use a dedicated network for Serai Also fixes SERAI_HOSTNAME passed to coordinator. * Support providing a key over the env for the Serai node * Enable and document running daemons for tests via serai-orchestrator Has running containers under the dev network port forward the RPC ports. * Use volumes for bitcoin/monero * Use bitcoin's run.sh in GH CI * Only use the volume for testnet (not dev)
2024-02-09 07:48:44 +00:00
let rpc = HttpRpc::new("http://serai:seraidex@127.0.0.1:18081".to_string()).await.unwrap();
// Only run once
if rpc.get_height().await.unwrap() != 1 {
return rpc;
}
let addr = MoneroAddress {
meta: AddressMeta::new(Network::Mainnet, AddressType::Standard),
2023-07-23 18:32:14 +00:00
spend: &random_scalar(&mut OsRng) * ED25519_BASEPOINT_TABLE,
view: &random_scalar(&mut OsRng) * ED25519_BASEPOINT_TABLE,
}
.to_string();
// Mine 40 blocks to ensure decoy availability
rpc.generate_blocks(&addr, 40).await.unwrap();
// Make sure we recognize the protocol
rpc.get_protocol().await.unwrap();
rpc
}
pub static SEQUENTIAL: OnceLock<Mutex<()>> = OnceLock::new();
#[macro_export]
macro_rules! async_sequential {
($(async fn $name: ident() $body: block)*) => {
$(
#[tokio::test]
async fn $name() {
let guard = runner::SEQUENTIAL.get_or_init(|| tokio::sync::Mutex::new(())).lock().await;
let local = tokio::task::LocalSet::new();
local.run_until(async move {
if let Err(err) = tokio::task::spawn_local(async move { $body }).await {
drop(guard);
Err(err).unwrap()
}
}).await;
}
)*
}
}
#[macro_export]
macro_rules! test {
(
$name: ident,
(
$first_tx: expr,
$first_checks: expr,
),
$((
$tx: expr,
$checks: expr,
)$(,)?),*
) => {
async_sequential! {
async fn $name() {
use core::{ops::Deref, any::Any};
use std::collections::HashSet;
#[cfg(feature = "multisig")]
use std::collections::HashMap;
use zeroize::Zeroizing;
use rand_core::OsRng;
use curve25519_dalek::constants::ED25519_BASEPOINT_TABLE;
#[cfg(feature = "multisig")]
use transcript::{Transcript, RecommendedTranscript};
#[cfg(feature = "multisig")]
use frost::{
curve::Ed25519,
Participant,
tests::{THRESHOLD, key_gen},
};
use monero_serai::{
random_scalar,
wallet::{
address::{Network, AddressSpec}, ViewPair, Scanner, Change, Decoys, FeePriority,
SignableTransaction, SignableTransactionBuilder,
},
};
use runner::{
random_address, rpc, mine_until_unlocked, get_miner_tx_output,
check_weight_and_fee,
};
type Builder = SignableTransactionBuilder;
// Run each function as both a single signer and as a multisig
#[allow(clippy::redundant_closure_call)]
for multisig in [false, true] {
// Only run the multisig variant if multisig is enabled
if multisig {
#[cfg(not(feature = "multisig"))]
continue;
}
let spend = Zeroizing::new(random_scalar(&mut OsRng));
#[cfg(feature = "multisig")]
let keys = key_gen::<_, Ed25519>(&mut OsRng);
let spend_pub = if !multisig {
2023-07-23 18:32:14 +00:00
spend.deref() * ED25519_BASEPOINT_TABLE
} else {
#[cfg(not(feature = "multisig"))]
panic!("Multisig branch called without the multisig feature");
#[cfg(feature = "multisig")]
keys[&Participant::new(1).unwrap()].group_key().0
};
let rpc = rpc().await;
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
let view = ViewPair::new(spend_pub, Zeroizing::new(random_scalar(&mut OsRng)));
let addr = view.address(Network::Mainnet, AddressSpec::Standard);
let miner_tx = get_miner_tx_output(&rpc, &view).await;
let protocol = rpc.get_protocol().await.unwrap();
let builder = SignableTransactionBuilder::new(
protocol,
rpc.get_fee(protocol, FeePriority::Unimportant).await.unwrap(),
Change::new(
2023-03-11 15:31:58 +00:00
&ViewPair::new(
2023-07-23 18:32:14 +00:00
&random_scalar(&mut OsRng) * ED25519_BASEPOINT_TABLE,
2023-03-11 15:31:58 +00:00
Zeroizing::new(random_scalar(&mut OsRng))
),
false
),
);
let sign = |tx: SignableTransaction| {
let spend = spend.clone();
#[cfg(feature = "multisig")]
let keys = keys.clone();
async move {
if !multisig {
tx.sign(&mut OsRng, &spend).unwrap()
} else {
#[cfg(not(feature = "multisig"))]
panic!("Multisig branch called without the multisig feature");
#[cfg(feature = "multisig")]
{
let mut machines = HashMap::new();
for i in (1 ..= THRESHOLD).map(|i| Participant::new(i).unwrap()) {
machines.insert(
i,
tx
.clone()
.multisig(
&keys[&i],
RecommendedTranscript::new(b"Monero Serai Test Transaction"),
)
.unwrap(),
);
}
frost::tests::sign_without_caching(&mut OsRng, machines, &[])
}
}
}
};
// TODO: Generate a distinct wallet for each transaction to prevent overlap
let next_addr = addr;
let temp = Box::new({
let mut builder = builder.clone();
let decoys = Decoys::fingerprintable_canonical_select(
&mut OsRng,
&rpc,
protocol.ring_len(),
rpc.get_height().await.unwrap(),
&[miner_tx.clone()],
)
.await
.unwrap();
builder.add_input((miner_tx, decoys.first().unwrap().clone()));
let (tx, state) = ($first_tx)(rpc.clone(), builder, next_addr).await;
let fee_rate = tx.fee_rate().clone();
let signed = sign(tx).await;
rpc.publish_transaction(&signed).await.unwrap();
mine_until_unlocked(&rpc, &random_address().2.to_string(), signed.hash()).await;
let tx = rpc.get_transaction(signed.hash()).await.unwrap();
check_weight_and_fee(&tx, fee_rate);
let scanner =
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
Scanner::from_view(view.clone(), Some(HashSet::new()));
($first_checks)(rpc.clone(), tx, scanner, state).await
});
#[allow(unused_variables, unused_mut, unused_assignments)]
let mut carried_state: Box<dyn Any> = temp;
$(
let (tx, state) = ($tx)(
protocol,
rpc.clone(),
builder.clone(),
next_addr,
*carried_state.downcast().unwrap()
).await;
let fee_rate = tx.fee_rate().clone();
let signed = sign(tx).await;
rpc.publish_transaction(&signed).await.unwrap();
mine_until_unlocked(&rpc, &random_address().2.to_string(), signed.hash()).await;
let tx = rpc.get_transaction(signed.hash()).await.unwrap();
if stringify!($name) != "spend_one_input_to_two_outputs_no_change" {
// Skip weight and fee check for the above test because when there is no change,
// the change is added to the fee
check_weight_and_fee(&tx, fee_rate);
}
#[allow(unused_assignments)]
{
let scanner =
Squashed commit of the following: commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 04:24:08 2023 -0500 Remove Scanner::address It either needed to return an Option, panic on misconfiguration, or return a distinct Scanner type based on burning bug immunity to offer this API properly. Panicking wouldn't be proper, and the Option<Address> would've been... awkward. The new register_subaddress function, maintaining the needed functionality, also provides further clarity on the intended side effect of the previously present Scanner::address function. commit 7359360ab2fc8c9255c6f58250c214252ce217a4 Author: Luke Parker <lukeparker5132@gmail.com> Date: Fri Jan 6 01:35:02 2023 -0500 fmt/clippy from last commit commit 80d912fc19cd268f3b019a9d9961a48b2c45e828 Author: Luke Parker <lukeparker5132@gmail.com> Date: Thu Jan 5 19:36:49 2023 -0500 Add Substrate "assets" pallet While over-engineered for our purposes, it's still usable. Also cleans the runtime a bit. commit 2ed2944b6598d75bdc3c995aaf39b717846207de Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 23:09:58 2023 -0500 Remove the timestamp pallet It was needed for contracts, which has since been removed. We now no longer need it. commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 22:52:41 2023 -0500 Initial validator sets pallet (#187) * Initial work on a Validator Sets pallet * Update Validator Set docs per current discussions * Update validator-sets primitives and storage handling * Add validator set pallets to deny.toml * Remove Curve from primitives Since we aren't reusing keys across coins, there's no reason for it to be on-chain (as previously planned). * Update documentation on Validator Sets * Use Twox64Concat instead of Identity Ensures an even distribution of keys. While xxhash is breakable, these keys aren't manipulatable by users. * Add math ops on Amount and define a coin as 1e8 * Add validator-sets to the runtime and remove contracts Also removes the randomness pallet which was only required by the contracts runtime. Does not remove the contracts folder yet so they can still be referred to while validator-sets is under development. Does remove them from Cargo.toml. * Add vote function to validator-sets * Remove contracts folder * Create an event for the Validator Sets pallet * Remove old contracts crates from deny.toml * Remove line from staking branch * Remove staking from runtime * Correct VS Config in runtime * cargo update * Resolve a few PR comments on terminology * Create a serai-primitives crate Move types such as Amount/Coin out of validator-sets. Will be expanded in the future. * Fixes for last commit * Don't reserve set 0 * Further fixes * Add files meant for last commit * Remove Staking transfer commit 3309295911d22177bd68972d138aea2f8658eb5f Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:17:00 2023 -0500 Reorder coins in README by market cap commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 06:07:58 2023 -0500 Update README commit 606484d744b1c6cc408382994c77f1def25d3e7d Author: Luke Parker <lukeparker5132@gmail.com> Date: Wed Jan 4 03:17:36 2023 -0500 cargo update commit 3a319b229fabd110cc28e5cc0cf718aa88b908bf Author: akildemir <aeg_asd@hotmail.com> Date: Wed Jan 4 16:26:25 2023 +0300 update address public API design commit d9fa88fa76eb361da79f81a1f7758ad19432aca7 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 13:35:06 2023 +0300 fix clippy error commit cc722e897b34afc1e517ece2fc5020d190d97804 Merge: cafa9b3 eeca440 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:39:04 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit cafa9b361e16a37981d45bf3031573c7bc48c5a0 Author: akildemir <aeg_asd@hotmail.com> Date: Mon Jan 2 11:38:26 2023 +0300 fix build errors commit ce5b5f2b37e7cc5a8ca84cbe64e3cefdbf0fe104 Merge: f502d67 49c4acf Author: akildemir <aeg_asd@hotmail.com> Date: Sun Jan 1 15:16:25 2023 +0300 Merge https://github.com/serai-dex/serai into develop commit f502d67282fe4951e3756f041e240c089a945a85 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:13:09 2022 +0300 fix pr issues commit 26ffb226d457ebf0d2f222c4ee6608971b4a8ffc Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 22 13:11:43 2022 +0300 remove extraneous rpc call commit 0e829f853151c06c54d9077b2477e59ac7a1e6e4 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:53 2022 +0300 add scan tests commit 5123c7f121a6823d5e03eeae7eff024a6b6d38c8 Author: akildemir <aeg_asd@hotmail.com> Date: Thu Dec 15 13:56:13 2022 +0300 add new address functions & comments
2023-01-06 09:33:17 +00:00
Scanner::from_view(view.clone(), Some(HashSet::new()));
carried_state =
Box::new(($checks)(rpc.clone(), tx, scanner, state).await);
}
)*
}
}
}
}
}