Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb3a936b63 | |||
| 9b704241a4 | |||
| 5ccd48e632 | |||
| 12d3fe8807 | |||
| 18fa25b703 | |||
| bcbcbad3cb |
@@ -2,6 +2,9 @@ name: Publish Nym binaries
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
env:
|
||||
NETWORK: mainnet
|
||||
|
||||
jobs:
|
||||
publish-nym:
|
||||
|
||||
Generated
+8
-8
@@ -581,7 +581,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "client-core"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"config",
|
||||
"crypto",
|
||||
@@ -1580,7 +1580,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "explorer-api"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"humantime-serde",
|
||||
@@ -3028,7 +3028,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-client"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"clap 2.34.0",
|
||||
"client-core",
|
||||
@@ -3062,7 +3062,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-gateway"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -3108,7 +3108,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-mixnode"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bs58",
|
||||
@@ -3146,7 +3146,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-requester"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"clap 2.34.0",
|
||||
"dirs",
|
||||
@@ -3167,7 +3167,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"clap 2.34.0",
|
||||
"client-core",
|
||||
@@ -3202,7 +3202,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-validator-api"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
@@ -26,7 +26,7 @@ clippy-all-wallet:
|
||||
cargo clippy --workspace --manifest-path nym-wallet/Cargo.toml --all-features -- -D warnings
|
||||
|
||||
test-main:
|
||||
cargo test --all-features --workspace
|
||||
cargo test --all-features --workspace --release
|
||||
|
||||
test-contracts:
|
||||
cargo test --manifest-path contracts/Cargo.toml --all-features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "client-core"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-client"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.56"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.56"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "nym-client-wasm"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jedrzej Stuczynski <andrew@nymtech.net>"]
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
edition = "2021"
|
||||
keywords = ["nym", "sphinx", "wasm", "webassembly", "privacy", "client"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
@@ -21,6 +21,6 @@ pub(crate) const REWARDING_VALIDATOR_ADDRESS: &str = "n10yyd98e2tuwu0f7ypz9dy3hh
|
||||
pub(crate) fn validators() -> Vec<ValidatorDetails> {
|
||||
vec![ValidatorDetails::new(
|
||||
"https://rpc.nyx.nodes.guru/",
|
||||
Some("https://api.nyx.nodes.guru/"),
|
||||
Some("https://validator.nymtech.net/api"),
|
||||
)]
|
||||
}
|
||||
|
||||
Generated
+1
-1
@@ -41,7 +41,7 @@ checksum = "f771a5d1f5503f7f4279a30f3643d3421ba149848b89ecaaec0ea2acf04a5ac4"
|
||||
|
||||
[[package]]
|
||||
name = "bandwidth-claim"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
dependencies = [
|
||||
"bandwidth-claim-contract",
|
||||
"config",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bandwidth-claim"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -30,12 +30,10 @@ use crate::rewards::queries::{
|
||||
};
|
||||
use crate::rewards::storage as rewards_storage;
|
||||
use cosmwasm_std::{
|
||||
entry_point, to_binary, Addr, Deps, DepsMut, Env, MessageInfo, QueryResponse, Response,
|
||||
Storage, Uint128,
|
||||
entry_point, to_binary, Addr, Deps, DepsMut, Env, MessageInfo, QueryResponse, Response, Uint128,
|
||||
};
|
||||
use cw_storage_plus::PrimaryKey;
|
||||
use mixnet_contract_common::{
|
||||
ContractStateParams, ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg, SphinxKey,
|
||||
ContractStateParams, ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg,
|
||||
};
|
||||
use time::OffsetDateTime;
|
||||
|
||||
@@ -386,87 +384,7 @@ pub fn query(deps: Deps<'_>, env: Env, msg: QueryMsg) -> Result<QueryResponse, C
|
||||
}
|
||||
|
||||
#[entry_point]
|
||||
pub fn migrate(deps: DepsMut<'_>, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
|
||||
use crate::mixnodes::storage::StoredMixnodeBond;
|
||||
use cw_storage_plus::{Index, IndexList, IndexedSnapshotMap, Strategy, UniqueIndex};
|
||||
use mixnet_contract_common::{Addr, IdentityKeyRef};
|
||||
|
||||
const MIXNODES_PK_NAMESPACE: &str = "mn";
|
||||
const MIXNODES_PK_CHECKPOINTS: &str = "mn__check";
|
||||
const MIXNODES_PK_CHANGELOG: &str = "mn__change";
|
||||
const MIXNODES_OWNER_IDX_NAMESPACE: &str = "mno";
|
||||
const MIXNODES_SPHINX_IDX_NAMESPACE: &str = "mns";
|
||||
|
||||
pub(crate) struct MixnodeBondIndex<'a> {
|
||||
pub(crate) owner: UniqueIndex<'a, Addr, StoredMixnodeBond>,
|
||||
}
|
||||
|
||||
impl<'a> IndexList<StoredMixnodeBond> for MixnodeBondIndex<'a> {
|
||||
fn get_indexes(
|
||||
&'_ self,
|
||||
) -> Box<dyn Iterator<Item = &'_ dyn Index<StoredMixnodeBond>> + '_> {
|
||||
let v: Vec<&dyn Index<StoredMixnodeBond>> = vec![&self.owner];
|
||||
Box::new(v.into_iter())
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn old_mixnodes<'a>(
|
||||
) -> IndexedSnapshotMap<'a, IdentityKeyRef<'a>, StoredMixnodeBond, MixnodeBondIndex<'a>> {
|
||||
let indexes = MixnodeBondIndex {
|
||||
owner: UniqueIndex::new(|d| d.owner.clone(), MIXNODES_OWNER_IDX_NAMESPACE),
|
||||
};
|
||||
IndexedSnapshotMap::new(
|
||||
MIXNODES_PK_NAMESPACE,
|
||||
MIXNODES_PK_CHECKPOINTS,
|
||||
MIXNODES_PK_CHANGELOG,
|
||||
Strategy::Never,
|
||||
indexes,
|
||||
)
|
||||
}
|
||||
|
||||
const PAGE_SIZE: usize = 50;
|
||||
|
||||
fn migrate_page(
|
||||
store: &mut dyn Storage,
|
||||
start_after: Option<String>,
|
||||
index: &mut UniqueIndex<'_, SphinxKey, StoredMixnodeBond>,
|
||||
) -> Option<String> {
|
||||
let start = start_after
|
||||
.as_deref()
|
||||
.map(cw_storage_plus::Bound::exclusive);
|
||||
|
||||
let page: Vec<_> = old_mixnodes()
|
||||
.range(store, start, None, cosmwasm_std::Order::Ascending)
|
||||
.map(|v| v.expect("failed to deserialize stored mixnode"))
|
||||
.collect();
|
||||
|
||||
let last_pk = if page.len() == PAGE_SIZE {
|
||||
Some(page.last().unwrap().0.clone())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
for (pk, mix) in page {
|
||||
index
|
||||
.save(store, &pk.joined_key(), &mix)
|
||||
.expect("failed to save new index information");
|
||||
}
|
||||
|
||||
last_pk
|
||||
}
|
||||
|
||||
// attempt to just add indices, see how it works out
|
||||
let mut sphinx_index: UniqueIndex<'_, SphinxKey, StoredMixnodeBond> = UniqueIndex::new(
|
||||
|d| d.mix_node.sphinx_key.clone(),
|
||||
MIXNODES_SPHINX_IDX_NAMESPACE,
|
||||
);
|
||||
|
||||
let mut start_after = None;
|
||||
|
||||
while let Some(new_start) = migrate_page(deps.storage, start_after.clone(), &mut sphinx_index) {
|
||||
start_after = Some(new_start)
|
||||
}
|
||||
|
||||
pub fn migrate(_deps: DepsMut<'_>, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
|
||||
Ok(Default::default())
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,8 @@ pub fn try_write_rewarded_set(
|
||||
return Err(ContractError::Unauthorized);
|
||||
}
|
||||
|
||||
// sanity check to make sure the sending validator is in sync with the contract state
|
||||
// (i.e. so that we'd known that top k nodes are actually expected to be active)
|
||||
if active_set_size != state.params.mixnode_active_set_size {
|
||||
// We don't want more then we need, less should be fine, as we could have less nodes bonded overall
|
||||
if active_set_size > state.params.mixnode_active_set_size {
|
||||
return Err(ContractError::UnexpectedActiveSetSize {
|
||||
received: active_set_size,
|
||||
expected: state.params.mixnode_active_set_size,
|
||||
@@ -43,15 +42,16 @@ pub fn try_write_rewarded_set(
|
||||
});
|
||||
}
|
||||
|
||||
let last_update = storage::CURRENT_REWARDED_SET_HEIGHT.load(deps.storage)?;
|
||||
let block_height = env.block.height;
|
||||
|
||||
if last_update + crate::constants::REWARDED_SET_REFRESH_BLOCKS > block_height {
|
||||
return Err(ContractError::TooFrequentRewardedSetUpdate {
|
||||
last_update,
|
||||
minimum_delay: crate::constants::REWARDED_SET_REFRESH_BLOCKS,
|
||||
current_height: block_height,
|
||||
});
|
||||
if let Some(last_update) = storage::CURRENT_REWARDED_SET_HEIGHT.may_load(deps.storage)? {
|
||||
if last_update + crate::constants::REWARDED_SET_REFRESH_BLOCKS > block_height {
|
||||
return Err(ContractError::TooFrequentRewardedSetUpdate {
|
||||
last_update,
|
||||
minimum_delay: crate::constants::REWARDED_SET_REFRESH_BLOCKS,
|
||||
current_height: block_height,
|
||||
});
|
||||
}
|
||||
}
|
||||
let num_nodes = rewarded_set.len();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "explorer-api"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-gateway"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||
description = "Implementation of the Nym Mixnet Gateway"
|
||||
edition = "2021"
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-mixnode"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = [
|
||||
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
|
||||
"Jędrzej Stuczyński <andrew@nymtech.net>",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-network-requester"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-validator-api"
|
||||
version = "1.0.0-rc.1"
|
||||
version = "1.0.0-rc.2"
|
||||
authors = [
|
||||
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
|
||||
"Jędrzej Stuczyński <andrew@nymtech.net>",
|
||||
|
||||
Reference in New Issue
Block a user