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/merged weight copying #230

Merged
merged 215 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
ddfeae7
temp: weight copying wip
saiintbrisson Aug 3, 2024
56bc7f8
make it compile
saiintbrisson Aug 25, 2024
35b328e
feat: wip
Supremesource Aug 27, 2024
30b9f91
feat: make yuma run
saiintbrisson Aug 28, 2024
66bd478
wip
Supremesource Aug 28, 2024
63898fc
wip
Supremesource Aug 28, 2024
72af72c
Feat/weight copy tests (#212)
Supremesource Sep 10, 2024
7818cdf
.
Supremesource Sep 13, 2024
a1d93c7
tests: encryption tests
devwckd Sep 11, 2024
1c0bb8d
feat: add (uids, weights) decoder to offwork extension
devwckd Sep 11, 2024
80e8f68
wip: offchain worker
Supremesource Sep 11, 2024
751dd79
feat: working add_copier_to_yuma_params
Supremesource Sep 12, 2024
5501302
chore: fmt
Supremesource Sep 12, 2024
0b0e3c3
feat: more robust offchain worker
Supremesource Sep 13, 2024
91f3a84
WIP
Supremesource Sep 14, 2024
676a025
feat: updating consensus
Supremesource Sep 14, 2024
77284b4
refac: move weight pallet (#224)
devwckd Sep 16, 2024
c880845
refac: pallet subspace
Supremesource Sep 21, 2024
64ee6f6
feat: offchain calls (#226)
devwckd Sep 22, 2024
bb94136
wip
devwckd Sep 24, 2024
236134a
wip
Supremesource Sep 27, 2024
9245237
temp wip
Supremesource Oct 2, 2024
b103e4b
feat: add hash and encrypt functions to the research markdown file
devwckd Oct 3, 2024
6c6a4bf
wip
Supremesource Oct 3, 2024
5378f29
wip
Supremesource Oct 5, 2024
bcc3a15
wip
Supremesource Oct 5, 2024
26dce6f
wip
devwckd Oct 6, 2024
2288c6f
wip
Supremesource Oct 7, 2024
ab69587
wip
Supremesource Oct 7, 2024
bc78a12
applying delta
Supremesource Oct 7, 2024
629006a
shorter if else
Supremesource Oct 7, 2024
9b96504
offworker structure cleanup
Supremesource Oct 7, 2024
553aedd
missing files
Supremesource Oct 7, 2024
865057c
feat: make non weight encrypted subnets run yuma
devwckd Oct 7, 2024
9e76429
wip
Supremesource Oct 8, 2024
27b50ca
wip tests
devwckd Oct 8, 2024
8c3592f
wip
Supremesource Oct 8, 2024
cc692e5
WIP
Supremesource Oct 8, 2024
7a1dee3
Fodase esta merda
Supremesource Oct 8, 2024
cd02ac6
wip
Supremesource Oct 8, 2024
6d3bc44
wip
Supremesource Oct 9, 2024
2f2edb6
skipping test
Supremesource Oct 9, 2024
55430b0
WIP: tests
Supremesource Oct 9, 2024
3e164ff
wip test
Supremesource Oct 9, 2024
79c9ca0
wip
Supremesource Oct 9, 2024
5df8e7c
fixing tests
Supremesource Oct 10, 2024
c3ddbd3
chore: make compile after rebase
devwckd Oct 10, 2024
760a3c8
chore: make compile & fix clippy errors
devwckd Oct 11, 2024
0acede6
WIP
Supremesource Oct 11, 2024
12109da
compile
Supremesource Oct 12, 2024
841d77f
wip
Supremesource Oct 11, 2024
03b9128
wip
Supremesource Oct 11, 2024
1a90d77
wip
Supremesource Oct 12, 2024
b4c03ab
feat: make it compile
Supremesource Oct 12, 2024
e9cf221
removing json file from test data
Supremesource Oct 12, 2024
ab4ad87
WIP
Supremesource Oct 12, 2024
3a097e2
feat: add key to encrypted weights
devwckd Oct 13, 2024
4b43e8a
wip
Supremesource Oct 15, 2024
5da4463
wip
Supremesource Oct 15, 2024
be93484
make it compile
Supremesource Oct 15, 2024
dca4ba9
make tests compile
Supremesource Oct 16, 2024
f86a06c
wip
Supremesource Oct 16, 2024
8277824
usin correct key type
Supremesource Oct 16, 2024
ea1faf1
removing diff
Supremesource Oct 16, 2024
0ed9258
fix: offworker test
Supremesource Oct 17, 2024
815158d
wip
Supremesource Oct 17, 2024
0c2bbb8
Merge branch 'main' into feat/merged-weight-copying
Supremesource Oct 17, 2024
bbc774a
updating lock
Supremesource Oct 17, 2024
3f54635
chore: removing useless code
Supremesource Oct 17, 2024
ee5cd2d
"feat: impl add_authorities"
Supremesource Oct 17, 2024
ff9bf93
feat: filtering by authority keep alive
Supremesource Oct 18, 2024
07ec117
wip
Supremesource Oct 18, 2024
aee6f9b
wip
Supremesource Oct 20, 2024
617704c
fix clippy
Supremesource Oct 20, 2024
ab6aa9d
Merge branch 'main' into feat/merged-weight-copying
Supremesource Oct 21, 2024
235887f
wip merge
Supremesource Oct 21, 2024
67bf1cc
reafacL dependency cleanup
Supremesource Oct 21, 2024
cc48e3f
chore: isolate complex type into definitions
devwckd Oct 21, 2024
81a4130
test: add decrypted weight receiving tests
devwckd Oct 23, 2024
7d20cec
update subnet params
Supremesource Oct 22, 2024
9bd45cd
fix: pallet string import
saiintbrisson Oct 22, 2024
f7d0812
chore: bump nix flake
steinerkelvin Oct 22, 2024
ff0da6c
fix: load rsa key from custom path
saiintbrisson Oct 23, 2024
99a552c
delegint manual
Supremesource Oct 23, 2024
31c1d41
fix: host functions
Supremesource Oct 23, 2024
0a80bc2
test: add node rotation test
devwckd Oct 26, 2024
795408b
fix test & benchmarks
Supremesource Oct 24, 2024
e5ccefc
fix/eth (#234)
Supremesource Oct 24, 2024
a809549
fix: impl self container call for eth
saiintbrisson Oct 25, 2024
97a1c60
fix: localnet manual seal
saiintbrisson Oct 25, 2024
38fc60b
chore bump to latest stable polkadot version
saiintbrisson Oct 25, 2024
0ea5d70
chore: add evm conversion
saiintbrisson Oct 25, 2024
1006cec
added optional contract deploy restrict
Supremesource Oct 26, 2024
5c98f67
wip
Supremesource Oct 28, 2024
d40e51b
feat adding precompiles
Supremesource Oct 28, 2024
7e555fa
test: fix subnet_emission offworker tests
devwckd Oct 28, 2024
2a00930
UPDATED CHANGELOG
Supremesource Oct 28, 2024
b2812c7
update changelog
Supremesource Oct 28, 2024
440b1fc
feat: new subnet param
Supremesource Oct 29, 2024
3b8f475
fix tests
Supremesource Oct 29, 2024
0b7570d
fix flake
Supremesource Oct 29, 2024
a640e00
fix: precomiple
Supremesource Oct 29, 2024
479b142
fix: use correct endianness for RSA public exponent in `get_encryptio…
steinerkelvin Oct 29, 2024
7877987
test: add decryption node ban test
devwckd Oct 30, 2024
ae5c705
fix: block number checks
Supremesource Oct 31, 2024
c5e4cc5
wtf
Supremesource Nov 2, 2024
f518c99
simper decryption node types
Supremesource Nov 3, 2024
414ec02
fix "cancel_expired_offchain_workers"
Supremesource Nov 3, 2024
712438d
add test of weight encryption and decryption to get values for extern…
steinerkelvin Oct 30, 2024
4445b61
add test for decrypting external encrypted weight data from Python im…
steinerkelvin Oct 31, 2024
d1acffa
wip
Supremesource Nov 3, 2024
d66b449
fix remove_subnet
Supremesource Nov 3, 2024
64e9956
chore
Supremesource Nov 3, 2024
8ef49af
remove diff file
Supremesource Nov 3, 2024
c14dea9
chore: cleanup
Supremesource Nov 4, 2024
9d5b0fb
fix: defaults cleanup
Supremesource Nov 4, 2024
cf50da6
added more macros...
Supremesource Nov 5, 2024
1cb8745
macro cleanup
Supremesource Nov 5, 2024
399b154
wip
Supremesource Nov 6, 2024
15929ae
wip
Supremesource Nov 6, 2024
fd9a6c9
fix: keep alive ping
Supremesource Nov 6, 2024
412a167
fix: offworker cancel
Supremesource Nov 6, 2024
f1c2d4b
fix: exponent storing
Supremesource Nov 6, 2024
b76c02e
fix: fix unreachable code warnings on new macros
aripiprazole Nov 6, 2024
fc5ef51
fix: tests
Supremesource Nov 7, 2024
35bd612
feat: add weight delegation
devwckd Nov 7, 2024
cfa5115
🔊: decryption logs
PsicoThePato Nov 7, 2024
8baed4f
Merge branch 'feat/merged-weight-copying' of github.com:agicommies/su…
PsicoThePato Nov 7, 2024
f756c19
wip
Supremesource Nov 7, 2024
c82574d
added todos
Supremesource Nov 8, 2024
0a9b3e2
wip tests
Supremesource Nov 9, 2024
9e522fd
feat: fix a bunch of wrong stuff
devwckd Nov 9, 2024
ce6f7f3
[REMOVE BEFORE MERGE] Add docker build for this branch
DaviPtrs Nov 11, 2024
37741c2
feat(subnet_emission): add validation to token_emission
aripiprazole Nov 12, 2024
e310784
feat(subnet_emission): check if registered, if not, add balance to ac…
aripiprazole Nov 12, 2024
8782917
feat: change delegated weight setting to when weights are set and add…
devwckd Nov 12, 2024
b85726b
test: fix delegation tests
devwckd Nov 13, 2024
cfec922
feat: remove duplicated stake checks on weight setting
devwckd Nov 13, 2024
ca48985
wip
Supremesource Nov 11, 2024
2d87795
fix: spec builder
Supremesource Nov 12, 2024
14deb82
wip
Supremesource Nov 13, 2024
2b218d4
fix: testnet compatibility
Supremesource Nov 13, 2024
88e17ba
wip
Supremesource Nov 13, 2024
f2148fa
feat: uniting subnet validation logic
Supremesource Nov 13, 2024
635b857
wip
Supremesource Nov 14, 2024
e1f26d3
bump spec version
Supremesource Nov 14, 2024
a4a78c4
feat: new fee structure
Supremesource Nov 14, 2024
b857c9c
fix: tests
Supremesource Nov 14, 2024
a22f4a0
chore: better module update extrinsic
Supremesource Nov 14, 2024
4a8b757
feat: fee storage migration
Supremesource Nov 14, 2024
26400e2
feat: simpler WeightSettingDelegation
Supremesource Nov 14, 2024
f0a6ec2
fix: make weight setting delegation work
devwckd Nov 14, 2024
e944b77
feat: copy parent weights on delegation
devwckd Nov 14, 2024
370d8d0
feat: added todos for Joao
Supremesource Nov 15, 2024
2735be4
Merge branch 'feat/merged-weight-copying' of github.com:agicommies/su…
Supremesource Nov 15, 2024
41ec918
feat: sending all decrypted weights
Supremesource Nov 15, 2024
588f81f
bump spec
Supremesource Nov 15, 2024
9cee73b
feat: adding weight migration
Supremesource Nov 15, 2024
1f32322
feat: clear hanging subnet states
devwckd Nov 15, 2024
8d77490
refac: decrypted
Supremesource Nov 15, 2024
51a4048
fix: clippy
Supremesource Nov 15, 2024
d6fb3d3
feat: offchain worker handles "undecryptable" weights
Supremesource Nov 15, 2024
0eff714
refac: removed WeightSetAt
Supremesource Nov 15, 2024
1193489
refac: testnet versions bump
Supremesource Nov 16, 2024
e7a6d5f
feat: return emission if no weights found
devwckd Nov 18, 2024
84aa0f8
wip
Supremesource Nov 18, 2024
b741103
fix: `Weights` insertion
Supremesource Nov 18, 2024
6100738
wip todos
Supremesource Nov 18, 2024
cd1ea32
feat: ignoring no weights on decrypted consensus
Supremesource Nov 19, 2024
407e2a1
wip: updated weights
Supremesource Nov 20, 2024
723f089
fix: encrypted weights clear
Supremesource Nov 20, 2024
193dff9
feat: activation_block logic
Supremesource Nov 20, 2024
2093f07
fix: offworker no consensus
Supremesource Nov 21, 2024
c117071
tests compile
Supremesource Nov 21, 2024
6f2c9cf
fix: vector order
Supremesource Nov 21, 2024
ab0492c
fix: node rotation order
Supremesource Nov 21, 2024
c7a8a8a
feat: fix rotation logic
Supremesource Nov 22, 2024
f1e6806
fix: rotation
Supremesource Nov 22, 2024
1b4374b
wip
Supremesource Nov 23, 2024
19c6c33
feat: adding offworker ban queu
Supremesource Nov 23, 2024
577b98f
fix: compile errs
Supremesource Nov 23, 2024
31ce9dd
fix: offworker callbacks
Supremesource Nov 24, 2024
8e46c47
flagging eth related functionality (#236)
Supremesource Nov 25, 2024
f641913
Add `--features testnet` to Dockerfile
DaviPtrs Nov 25, 2024
beb4b28
fix: migrations
Supremesource Nov 26, 2024
1e728ca
feat: more efficient subnet clear
Supremesource Nov 28, 2024
4be2d2b
fix: clippy
Supremesource Nov 28, 2024
344a9f1
feat: better copier bonds calc
Supremesource Nov 29, 2024
1c858cc
feat: moved deregistration check
Supremesource Nov 29, 2024
b735cdf
revert: build-docker.yaml
Supremesource Nov 29, 2024
03aa090
revert: dockerfile flag
Supremesource Nov 29, 2024
552b9ee
Merge branch 'main' into feat/merged-weight-copying
Supremesource Nov 29, 2024
d19b08d
fix: remove autoimport
Supremesource Nov 29, 2024
f8b6eb5
revert: vscode settings
Supremesource Nov 29, 2024
236e30b
refac: removed empty files
Supremesource Nov 29, 2024
c727759
refac: removing redundant apis
Supremesource Nov 29, 2024
0d077eb
test: fix decryption node ban test
devwckd Nov 29, 2024
73a3dd1
test: fix consensus result test
devwckd Nov 29, 2024
9b6eb9f
chore: fix weights on changelog
devwckd Nov 29, 2024
7863c49
refac: decrypted weights fn
Supremesource Nov 29, 2024
d2a2144
fix: clippy errors
Supremesource Nov 29, 2024
ebdce69
wip test
devwckd Nov 29, 2024
b40a15c
wip test
devwckd Nov 30, 2024
dabd1ae
fix: weight validation
Supremesource Nov 30, 2024
817bf5c
fix: weight check
Supremesource Nov 30, 2024
a37dae4
wip test
Supremesource Nov 30, 2024
091c914
refac: `prepare_weights`
Supremesource Nov 30, 2024
9ac4f81
wip: tests
Supremesource Nov 30, 2024
ae0085b
fix: tests & is_registered check
Supremesource Nov 30, 2024
e8afa21
feat: migration
Supremesource Dec 2, 2024
09444bc
fix: process subnets
Supremesource Dec 2, 2024
cf4411a
fix: suggestions
Supremesource Dec 2, 2024
fc04b42
wip benchmarks
Supremesource Dec 2, 2024
755f787
feat: added benchmarks
Supremesource Dec 2, 2024
b761321
fuck phantom data
Supremesource Dec 2, 2024
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
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/change-a-hyperparameter.md

This file was deleted.

46 changes: 0 additions & 46 deletions .github/ISSUE_TEMPLATE/report-a-bug.md

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches: [main]
tags:
- '*'

- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
117 changes: 115 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,118 @@
# Changelog

spec version `126`

**Breaking Changes**

Moved:
- `set_weights` extrinsic has been moved to `SubnetEmissionModule` from `SubspaceModule`.
- `delegate_rootnet_control` extrinsic has been moved to `SubnetEmissionModule` from `SubspaceModule`.
- Some storages have been moved to `SubnetEmissionModule` from `SubspaceModule`:
- WeightEncryptionMap
-
Deleted:
- `TrustRatio`

**New Storages**
Offchain Worker Module:
- `MeasuredStakeAmount`:
- Description: The amount of actual consensus sum stake. Used for a simulated consensus.
- Type: StorageValue<Percent>
- Default: 5%

- `IrrationalityDelta`:
- Description: The amount of delta between cumulative copier dividends and cumulative delegator dividends.
- Type: StorageMap<u16, I64F64>
- Default: None (empty map)

Subnet Emission Module:
- `BannedDecryptionNodes`:
- Description: A list of nodes that are banned from decrypting the network weights.
- Type: StorageMap<T::AccountId, u64>
- Default: None (empty map)

- `EncryptedWeights`:
- Description: The encrypted weights of the network.
- Type: StorageDoubleMap<u16, u16, Vec<u8>>
- Default: None (empty map)

- `Authorities`:
- Description: Association of signing public keys with associated rsa encryption public keys.
- Type: StorageValue<BoundedVec<(T::AccountId, PublicKey), T::MaxAuthorities>>
- Default: Empty BoundedVec

- `DecryptionNodes`:
- Description: This storage is managed dynamically based on the do_keep_alive offchain worker call. It is built from the authorities storage.
- Type: StorageValue<Vec<DecryptionNodeInfo<T>>>
- Default: Empty Vec

- `SubnetDecryptionData`:
- Description: Decryption Node Info assigned to subnet, includes information about the decryption node responsible for the subnet.
- Type: StorageMap<u16, SubnetDecryptionInfo<T>>
- Default: None (empty map)

- `DecryptionNodeCursor`:
- Description: Cursor for the decryption node rotation.
- Type: StorageValue<u16>
- Default: 0

- `ConsensusParameters`:
- Description: Stores all data needed to run consensus.
- Type: StorageDoubleMap<u16, u64, ConsensusParams<T>>
- Default: None (empty map)

- `WeightEncryptionData`:
- Description: Stores both the encrypted weight and hash of a validator on a subnet.
- Type: StorageDoubleMap<u16, u16, EncryptionMechanism>
- Default: None (empty double map)

- `DecryptionNodeBanQueue`:
- Description: Queue of decryption nodes that will be banned next epoch.
- Type: StorageDoubleMap<u16, T::AccountId, u64>
- Default: None (empty double map)

Subspace Module:
- `MaxEncryptionPeriod`:
- Description: The maximum amount of blocks weights can stay encrypted for, a specific subnet.
- Type: StorageMap<u16, u64>
- Default: 2000
- • Part of `SubnetParams` struct, can be updated by the subnet owner

- `CopierMargin`:
- Description: Allowed percentage profit margin of rationality above full irrationality for the weight copying strategy.
- Type: StorageMap<u16, I64F64>
- Default: 0
- • Part of `SubnetParams` struct, can be updated by the subnet owner

- `UseWeightsEncryption`:
- Description: A flag to enable or disable weights encryption for a specific subnet.
- Type: StorageMap<u16, bool>
- Default: None (empty map)
- • Part of `SubnetParams` struct, can be updated by the subnet owner

- `AlphaValues`:
- Description: The alpha values for liquid alpha.
- Type: StorageMap<u16, (u16, u16)>
- Default: (45875, 58982)

**New Extrinsics**
- `set_weights_encrypted` in `SubnetEmissionModule`

**New Offchain Worker Extrinsics**
These extrinsics are meant to be called by offchain workers only and should not be invoked directly:
- `send_decrypted_weights` in `OffworkerModule`
- `send_ping` in `OffworkerModule`

**New Root-Only Extrinsic**
- `add_authorities` in `OffworkerModule`

**Other Changes**
- introducing weight copying prevention
- evm functionality was fixed
- linear consensus and yuma consensus were refactored to reuse parts of the same code
- migration of weights to subnet emission module
- general codebase refactor

spec version `125`

updated metadata removal variable
Expand Down Expand Up @@ -57,7 +170,7 @@ Extrinsics:
- `add_global_params_proposal` no longer takes `min_burn` and `max_burn`
- `update_subnet` now takes `min_burn` and `max_burn`

spec_version `118-119`
'spec_version' `118-119`

This branch starts off of the commit hash `95e5d26b550839c24fd367090e02abaa37df3d32`.
diff [here](https://github.com/agicommies/subspace-network/compare/db8a19b1d2155d3ecda4172aaf72cdeea1feda2b...agicommies:subspace-network:feat/global-stake)
Expand Down Expand Up @@ -89,7 +202,7 @@ Rootnet validators are capable of calling this extrinsic. The weight setting of

`spec_version: 117`

This version delivers on the [GovernanceProposal](https://governance.communeai.org/proposal/4).
This version delivers on the [GovernanceProposal](https://governance.communeai.org/proposal/4).f

### Introducing the new `GovernanceModule` pallet

Expand Down
Loading
Loading