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

feat!: Snakenet gen2 - governance, epoch times and treasury #188

Merged
merged 67 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
2b228d9
feat: add bounties pallet
Roznovjak Mar 19, 2021
464a19d
build: bump runtime versions
Roznovjak Mar 20, 2021
16587df
feat!: setup technical committee
Roznovjak Mar 23, 2021
84d2464
Merge branch 'feat/governance' into feat/add_bountie_pallet
green-jay Mar 25, 2021
a7199ca
Merge pull request #166 from Roznovjak/feat/add_bountie_pallet
green-jay Mar 25, 2021
0af2643
Merge branch 'feat/governance' into feat/setup_technical_committee
green-jay Mar 25, 2021
66aac23
Merge pull request #174 from Roznovjak/feat/setup_technical_committee
green-jay Mar 25, 2021
c8fd1ef
initial setup of treasury
green-jay Mar 25, 2021
07751c2
add Intergalactic as council member
green-jay Mar 25, 2021
85bf7ac
Epoch changed to 4 hours
jak-pan Mar 29, 2021
0ae59d6
Merge branch 'master' into feat/epoch-duration
jak-pan Mar 29, 2021
f48f545
Merge branch 'master' into feat/epoch-duration
jak-pan Mar 29, 2021
fce84ac
epoch duration changed to 2 hours
mrq1911 Mar 29, 2021
7e412be
add democracy
green-jay Mar 30, 2021
cf07563
forked build utils
mrq1911 Mar 30, 2021
41df9a7
getting release and runtime version
mrq1911 Mar 30, 2021
9d681fb
go home clippy, ur 🍺
mrq1911 Mar 30, 2021
89405a3
Merge branch 'master' into tagged-version-info
mrq1911 Mar 31, 2021
60d455f
prepare phase1
green-jay Mar 31, 2021
f477ac0
add elected member to fix tips
green-jay Mar 31, 2021
460e9e4
Merge branch 'shedding' into feat/epoch-duration
jak-pan Mar 31, 2021
c54efcf
Merge pull request #187 from galacticcouncil/feat/epoch-duration
jak-pan Mar 31, 2021
02b9803
Merge branch 'shedding' into feat/governance
jak-pan Mar 31, 2021
de06183
Merge pull request #183 from galacticcouncil/feat/governance
jak-pan Mar 31, 2021
58ca3aa
Merge branch 'master' into shedding
jak-pan Mar 31, 2021
a58d040
Added config, democracy, debug call filter
jak-pan Apr 1, 2021
5c1abc9
Updated BaseFilter to allow offences
martinfridrich Apr 1, 2021
d805c42
Merge branch 'shedding' into bug/slashing_is_not_applied
jak-pan Apr 1, 2021
cfcf092
Merge pull request #199 from galacticcouncil/bug/slashing_is_not_applied
jak-pan Apr 1, 2021
d7df33a
Balances working, changed toolchain, WIP governance/Tips
jak-pan Apr 2, 2021
8d178e3
Fix elections (backing)
jak-pan Apr 2, 2021
db75e2d
change some defaults
jak-pan Apr 2, 2021
56f41db
Merge branch 'master' into shedding
jak-pan Apr 6, 2021
62defa7
fix toolchain (rebuilds) + clippy
jak-pan Apr 6, 2021
79d2c46
tidy
jak-pan Apr 7, 2021
6989c4c
genesis history pallet
mrq1911 Apr 7, 2021
70b7f33
pls no std 💉
mrq1911 Apr 7, 2021
09ee672
need config, not call
mrq1911 Apr 7, 2021
015b5fd
fix test
mrq1911 Apr 7, 2021
b26d232
fix test build
enthusiastmartin Apr 7, 2021
da585c6
disable balances tests
jak-pan Apr 7, 2021
d488194
update spec
jak-pan Apr 7, 2021
781b08f
tests, types
mrq1911 Apr 8, 2021
824dc9e
Merge branch 'shedding' into genesis-history-pallet
mrq1911 Apr 8, 2021
3bd0bb6
Merge pull request #202 from galacticcouncil/genesis-history-pallet
mrq1911 Apr 8, 2021
1d28a6b
add tech committee
jak-pan Apr 8, 2021
1159f7e
Merge branch 'shedding' of github.com:galacticcouncil/HydraDX-node in…
jak-pan Apr 8, 2021
63e7617
Update runtime/src/lib.rs
jak-pan Apr 9, 2021
7d57cce
Update wasm_builder_runner to ubstrate_wasm_builder
martinfridrich Apr 9, 2021
8ccc9c5
change bonding duration + change tip application time
jak-pan Apr 10, 2021
d843cce
Merge branch 'shedding' of github.com:galacticcouncil/HydraDX-node in…
jak-pan Apr 10, 2021
8efb380
add unsold tokens to treasury
jak-pan Apr 10, 2021
a841a2a
clippy
jak-pan Apr 10, 2021
a15d4bb
fix(runtime): add tx fee multiplier
enthusiastmartin Apr 12, 2021
b334a87
Merge pull request #208 from galacticcouncil/fix/tx_fee_multiplier
jak-pan Apr 12, 2021
822dfb5
previous chain hashes set
mrq1911 Apr 13, 2021
be1e7b3
renamed to Snakenet Gen2
mrq1911 Apr 13, 2021
441da41
derive default genesis chain
mrq1911 Apr 14, 2021
5d5490c
Added Gen2 spec
jak-pan Apr 15, 2021
b6ad3d2
bump spec_version, changed bootnodes port
martinfridrich Apr 16, 2021
8819ce8
Merge pull request #211 from galacticcouncil/derived-default-genesis-…
jak-pan Apr 16, 2021
6021cd2
Merge branch 'master' into tagged-version-info
mrq1911 Apr 16, 2021
327e815
ci: checkout HEAD for action instead of merge commit
mrq1911 Apr 17, 2021
d9dc1d1
add telemetry.hydradx.io
martinfridrich Apr 19, 2021
6f3bec2
Merge branch 'shedding' into tagged-version-info
mrq1911 Apr 19, 2021
ca7f52e
cargo.lock update
jak-pan Apr 19, 2021
d09f25b
Merge pull request #194 from galacticcouncil/tagged-version-info
mrq1911 Apr 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@
.local

.idea/
.vscode/

.env

*.orig

# Custom chainspec(frido)
balice*
63 changes: 56 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ frame-system = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4
frame-system-benchmarking = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
frame-system-rpc-runtime-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-balances = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-grandpa = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-democracy = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-election-provider-multi-phase = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-grandpa = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-identity = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-randomness-collective-flip = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-scheduler = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-sudo = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-timestamp = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-tips = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-transaction-payment-rpc = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-transaction-payment-rpc-runtime-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
pallet-identity = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
sc-basic-authorship = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
sc-chain-spec = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
sc-cli = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'}
Expand Down Expand Up @@ -103,6 +104,7 @@ members = [
'pallets/asset-registry',
'pallets/exchange',
'pallets/transaction-multi-payment',
'pallets/genesis-history',
'primitives',
'runtime',
]
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,16 @@ Then open settings screen -> developer and paste
]
},
"LookupSource": "AccountId",
"Price": "Balance"
"Price": "Balance",
"Chain": {
"genesisHash": "Vec<u8>",
"lastBlockHash": "Vec<u8>"
}
}
```

Connect to the
- Hacknet: `wss://hack.hydradx.io:9944`
Connect to the
- Hacknet: `wss://hack.hydradx.io:9944`
- [Stakenet](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-01.snakenet.hydradx.io): `wss://rpc-01.snakenet.hydradx.io`
- or local node.

Expand All @@ -117,7 +121,7 @@ From the top-level node directory:
./scripts/check_performance.sh
```

This will run series of benchmarks ( which may take a while).
This will run series of benchmarks ( which may take a while).
The output will show benchmark results of HydraDX pallets and comparison against reference values.

The most interesting information would be the difference between the HydraDx benchmark value and the local machine's benchmark.
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build = 'build.rs'
description = 'Hydra DX'
edition = '2018'
homepage = 'https://github.com/galacticcouncil/hydradx-node'
license = 'Unlicense'
license = 'Apache 2.0'
name = 'hydra-dx'
repository = 'https://github.com/galacticcouncil/hydradx-node'
version = '3.0.1'
Expand Down
56 changes: 48 additions & 8 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use hydra_dx_runtime::pallet_claims::EthereumAddress;
use hydra_dx_runtime::{
AccountId, AssetRegistryConfig, AuthorityDiscoveryConfig, BabeConfig, BalancesConfig, ClaimsConfig, CouncilConfig,
ElectionsConfig, FaucetConfig, GenesisConfig, GrandpaConfig, ImOnlineConfig, Perbill, SessionConfig, Signature,
StakerStatus, StakingConfig, SudoConfig, SystemConfig, TokensConfig, CORE_ASSET_ID, WASM_BINARY,
StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TokensConfig, GenesisHistoryConfig,
CORE_ASSET_ID, WASM_BINARY,
};
use pallet_staking::Forcing;
use sc_service::ChainType;
Expand Down Expand Up @@ -107,6 +108,8 @@ pub fn development_config() -> Result<ChainSpec, String> {
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
// Treasury
hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into(),
],
true,
)
Expand Down Expand Up @@ -253,6 +256,8 @@ pub fn local_testnet_config() -> Result<ChainSpec, String> {
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
// Treasury
hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into(),
],
true,
)
Expand Down Expand Up @@ -299,7 +304,7 @@ fn testnet_genesis(
.map(|k| (k, 1_000_000u128 * HDX))
.collect(),
}),
pallet_grandpa: Some(GrandpaConfig { authorities: vec![] }),
pallet_grandpa: Default::default(),
pallet_sudo: Some(SudoConfig {
// Assign network admin rights.
key: root_key,
Expand Down Expand Up @@ -339,8 +344,8 @@ fn testnet_genesis(
}),
pallet_babe: Some(BabeConfig { authorities: vec![] }),
pallet_authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }),
pallet_im_online: Some(ImOnlineConfig { keys: vec![] }),
pallet_treasury: Some(Default::default()),
pallet_im_online: Default::default(),
pallet_treasury: Default::default(),
pallet_session: Some(SessionConfig {
keys: initial_authorities
.iter()
Expand All @@ -365,11 +370,25 @@ fn testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
}),
pallet_elections_phragmen: Some(ElectionsConfig { members: vec![] }),
pallet_collective_Instance1: Some(CouncilConfig::default()),
pallet_elections_phragmen: Some(ElectionsConfig {
members: vec![(get_account_id_from_seed::<sr25519::Public>("Alice"), STASH / 2)],
}),
pallet_collective_Instance1: Some(CouncilConfig {
members: vec![get_account_id_from_seed::<sr25519::Public>("Alice")],
phantom: Default::default(),
}),
pallet_collective_Instance2: Some(TechnicalCommitteeConfig {
members: vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
],
phantom: Default::default(),
}),
pallet_claims: Some(ClaimsConfig {
claims: create_testnet_claims(),
}),
pallet_genesis_history: Some(GenesisHistoryConfig::default()),
}
}

Expand Down Expand Up @@ -469,9 +488,30 @@ fn lerna_genesis(
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
}),
pallet_elections_phragmen: Some(ElectionsConfig { members: vec![] }),
pallet_collective_Instance1: Some(CouncilConfig::default()),
pallet_elections_phragmen: Some(ElectionsConfig {
members: vec![(
hex!["0abad795adcb5dee45d29528005b1f78d55fc170844babde88df84016c6cd14d"].into(),
STASH,
)],
}),
pallet_collective_Instance1: Some(CouncilConfig {
// Intergalactic council member
members: vec![hex!["0abad795adcb5dee45d29528005b1f78d55fc170844babde88df84016c6cd14d"].into()],
phantom: Default::default(),
}),
pallet_collective_Instance2: Some(TechnicalCommitteeConfig {
members: vec![
hex!["d6cf8789dce651cb54a4036406f4aa0c771914d345c004ad0567b814c71fb637"].into(),
hex!["bc96ec00952efa8f0e3e08b36bf5096bcb877acac536e478aecb72868db5db02"].into(),
hex!["2875dd47bc1bcb70e23de79e7538c312be12c716033bbae425130e46f5f2b35e"].into(),
hex!["644643bf953233d08c4c9bae0acd49f3baa7658d9b342b7e6879bb149ee6e44c"].into(),
hex!["ccdb435892c9883656d0398b2b67023ba1e11bda0c7f213f70fdac54c6abab3f"].into(),
hex!["f461c5ae6e80bf4af5b84452789c17b0b0a095a2d77c2a407978147de2d5b572"].into(),
],
phantom: Default::default(),
}),
pallet_claims: Some(ClaimsConfig { claims: vec![] }),
pallet_genesis_history: Some(GenesisHistoryConfig::default()),
}
}

Expand Down
4 changes: 2 additions & 2 deletions pallets/amm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ['GalacticCouncil']
description = 'HydraDX AMM Module'
edition = '2018'
homepage = 'https://github.com/galacticcouncil/hydradx-node'
license = 'Unlicense'
license = 'Apache 2.0'
name = 'pallet-amm'
repository = 'https://github.com/galacticcouncil/hydradx-node'
version = '3.0.0'
Expand All @@ -25,7 +25,7 @@ version = '2.0.0'
primitive-types = {default-features = false, version = '0.8.0'}
serde = {features = ['derive'], optional = true, version = '1.0.101'}

hydra-dx-math = {default-features = false, version = "1.0.0", git = "https://github.com/galacticcouncil/hydraDX-math", tag="v1.0.0"}
hydra-dx-math = {default-features = false, version = "1.0.0", git = "https://github.com/galacticcouncil/hydraDX-math", tag = "v1.0.0"}

# Local dependencies
pallet-asset-registry = {path = '../asset-registry', default-features = false}
Expand Down
2 changes: 1 addition & 1 deletion pallets/asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ['GalacticCouncil']
description = 'FRAME Pallet for asset registry management'
edition = '2018'
homepage = 'https://github.com/galacticcouncil/hydradx-node'
license = 'Unlicense'
license = 'Apache 2.0'
name = 'pallet-asset-registry'
repository = 'https://github.com/galacticcouncil/hydradx-node'
version = '3.0.0'
Expand Down
41 changes: 41 additions & 0 deletions pallets/balances/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[package]
authors = ["Parity Technologies <[email protected]>"]
description = "FRAME pallet to manage balances"
edition = "2018"
homepage = "https://substrate.dev"
license = "Apache-2.0"
name = "pallet-balances"
readme = "README.md"
repository = "https://github.com/paritytech/substrate/"
version = "3.0.0"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = {package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"]}
frame-benchmarking = {version = "3.1.0", default-features = false, optional = true}
frame-support = {version = "3.0.0", default-features = false}
frame-system = {version = "3.0.0", default-features = false}
serde = {version = "1.0.101", optional = true}
sp-runtime = {version = "3.0.0", default-features = false}
sp-std = {version = "3.0.0", default-features = false}

[dev-dependencies]
pallet-transaction-payment = {version = "3.0.0"}
sp-core = {version = "3.0.0"}
sp-io = {version = "3.0.0"}

[features]
default = ["std"]
runtime-benchmarks = ["frame-benchmarking"]
std = [
"serde",
"codec/std",
"sp-std/std",
"sp-runtime/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
]
try-runtime = ["frame-support/try-runtime"]
Loading