Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

DAC Validator pallet crate #200

Draft
wants to merge 203 commits into
base: dev-cere
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
3ee1010
An empty DAC Validator pallet crate
khssnv Mar 16, 2023
9998f50
Add DAC Validator pallet to the runtime
khssnv Mar 17, 2023
d1ee63f
Era counter with privileged inc for DAC Validator
khssnv Mar 17, 2023
2a1b946
Hooks and storage items for DAC Validator
khssnv Mar 17, 2023
643a6c8
add function fetch_tasks
Raid5594 Mar 17, 2023
15b8341
Create OCW, read from redis, compare bytes sent and bytes recieved, s…
MRamanenkau Mar 1, 2023
065e533
Assign a random DAC validator for each edge
khssnv Mar 20, 2023
f9c39b5
Update Cargo.lock
khssnv Mar 20, 2023
9834b14
Assign DAC validation tasks on era increment
khssnv Mar 20, 2023
7c0d2f8
Format DAC Validator files
khssnv Mar 20, 2023
25bb5ef
adjust era
Raid5594 Mar 21, 2023
b145676
fix era
Raid5594 Mar 21, 2023
406b434
Prepare for demo
MRamanenkau Mar 21, 2023
af80544
merge offchain worker with ddc validator
Raid5594 Mar 22, 2023
f640a5b
add proof of delivery
Raid5594 Mar 22, 2023
041fbe9
add PoD trigger in offchain worker
Raid5594 Mar 22, 2023
9a797bd
Fix json parse error for cases when in the response not 2 cdn nodes
MRamanenkau Mar 22, 2023
aafe664
Move JSON parsing fix to ddc-validator
MRamanenkau Mar 23, 2023
332fd30
fix timestamp bug
Raid5594 Mar 23, 2023
66a17f4
Autoformat DAC Validator files
khssnv Mar 24, 2023
9dd6178
add filtering of requests
Raid5594 Mar 24, 2023
507b6b9
Refactor guard condition
khssnv Mar 27, 2023
1a77df7
Refactor a guard condition to decrease indentation
khssnv Mar 27, 2023
1b1c13d
Removed poc pallet
MRamanenkau Mar 27, 2023
fbf4cdf
Use era type from staking primitives
khssnv Mar 27, 2023
27121ec
Fix faulty hook on block initialization
khssnv Mar 28, 2023
6771d11
Autoformat DAC Validator files
khssnv Mar 28, 2023
36ff86e
Typo fix
khssnv Mar 28, 2023
1a92624
Introduce era key for DAC validator tasks
khssnv Mar 28, 2023
e8dc17d
Set DAC Validators quorum size in runtime crate
khssnv Mar 29, 2023
3c23004
Print pubkeys available to offchain worker
khssnv Mar 29, 2023
2e8d0f6
merge with latest commit
Raid5594 Mar 29, 2023
a415b9b
fix merge
Raid5594 Mar 29, 2023
816dff7
fix typo
Raid5594 Mar 29, 2023
bd2f5b7
Add doc comments
khssnv Mar 29, 2023
5b330b5
Module level docs
khssnv Mar 29, 2023
12a1e61
Remove http request from tx
MRamanenkau Mar 29, 2023
311a270
Submit DAC Validation decision call
khssnv Mar 30, 2023
0239ff1
Set shorted duration
Jan 14, 2022
3d4ea10
Update EPOCH_DURATION_IN_BLOCKS
MRamanenkau Nov 1, 2022
a7c5498
Revert "Update EPOCH_DURATION_IN_BLOCKS"
MRamanenkau Mar 31, 2023
6934eb1
Revert "Set shorted duration"
MRamanenkau Mar 31, 2023
25cb8a8
Fix validation decision update
khssnv Mar 31, 2023
2f19221
Typo fix
khssnv Mar 31, 2023
ee6ba67
Try integrate unit tests
MRamanenkau Apr 11, 2023
4d1fc22
An empty DAC Validator pallet crate
khssnv Mar 16, 2023
c56af3c
Add DAC Validator pallet to the runtime
khssnv Mar 17, 2023
2a4317f
Era counter with privileged inc for DAC Validator
khssnv Mar 17, 2023
29eedab
Hooks and storage items for DAC Validator
khssnv Mar 17, 2023
0c06af2
add function fetch_tasks
Raid5594 Mar 17, 2023
e4ff6e9
Create OCW, read from redis, compare bytes sent and bytes recieved, s…
MRamanenkau Mar 1, 2023
3f57edc
Assign a random DAC validator for each edge
khssnv Mar 20, 2023
1b203e2
Update Cargo.lock
khssnv Mar 20, 2023
ab2d07f
Assign DAC validation tasks on era increment
khssnv Mar 20, 2023
11b3f21
Format DAC Validator files
khssnv Mar 20, 2023
09ccc05
adjust era
Raid5594 Mar 21, 2023
1215c47
fix era
Raid5594 Mar 21, 2023
0319c85
Prepare for demo
MRamanenkau Mar 21, 2023
495f40a
merge offchain worker with ddc validator
Raid5594 Mar 22, 2023
8ea8d8e
add proof of delivery
Raid5594 Mar 22, 2023
ce82be5
add PoD trigger in offchain worker
Raid5594 Mar 22, 2023
54dd70c
Fix json parse error for cases when in the response not 2 cdn nodes
MRamanenkau Mar 22, 2023
cf131e6
Move JSON parsing fix to ddc-validator
MRamanenkau Mar 23, 2023
9b650db
fix timestamp bug
Raid5594 Mar 23, 2023
09afaf1
Autoformat DAC Validator files
khssnv Mar 24, 2023
a5aafac
add filtering of requests
Raid5594 Mar 24, 2023
fee7b81
Refactor guard condition
khssnv Mar 27, 2023
ed167c8
Refactor a guard condition to decrease indentation
khssnv Mar 27, 2023
2856c6e
Removed poc pallet
MRamanenkau Mar 27, 2023
7490181
Use era type from staking primitives
khssnv Mar 27, 2023
3b4f852
Fix faulty hook on block initialization
khssnv Mar 28, 2023
df14bb4
Autoformat DAC Validator files
khssnv Mar 28, 2023
0746e1e
Typo fix
khssnv Mar 28, 2023
43b6ddc
Introduce era key for DAC validator tasks
khssnv Mar 28, 2023
4ce11d2
Set DAC Validators quorum size in runtime crate
khssnv Mar 29, 2023
3359fe7
Print pubkeys available to offchain worker
khssnv Mar 29, 2023
ddbf261
merge with latest commit
Raid5594 Mar 29, 2023
5a2f0d3
fix merge
Raid5594 Mar 29, 2023
acb9b0f
fix typo
Raid5594 Mar 29, 2023
15292ee
Add doc comments
khssnv Mar 29, 2023
0ef5dc5
Module level docs
khssnv Mar 29, 2023
3df787c
Remove http request from tx
MRamanenkau Mar 29, 2023
b59d09b
Submit DAC Validation decision call
khssnv Mar 30, 2023
bdec8e7
Set shorted duration
Jan 14, 2022
82bd1de
Update EPOCH_DURATION_IN_BLOCKS
MRamanenkau Nov 1, 2022
847d71a
Revert "Update EPOCH_DURATION_IN_BLOCKS"
MRamanenkau Mar 31, 2023
db7d0d1
Revert "Set shorted duration"
MRamanenkau Mar 31, 2023
a211227
Fix validation decision update
khssnv Mar 31, 2023
2b81514
Typo fix
khssnv Mar 31, 2023
c2c6d5f
Integer type ValidationThreshold
khssnv Apr 10, 2023
7a0e601
Autoformat DAC Validator files
khssnv Apr 10, 2023
5e811fb
Set PoD allowed deviation in runtime crate
khssnv Apr 10, 2023
84d4a02
Update spec version
MRamanenkau Apr 13, 2023
b70df07
DAC Validators run a process by signal
khssnv Apr 14, 2023
c30b46e
Update Cargo.lock
khssnv Apr 14, 2023
ae63769
fix(ddc-validator): compilation error is fixed
yahortsaryk Apr 15, 2023
5c89bf9
Merge pull request #207 from Cerebellum-Network/feature/integrate-uni…
MRamanenkau Apr 17, 2023
959e66c
Fix MaxNominations config
MRamanenkau Apr 17, 2023
2362a51
Reorder imps block according to construct_runtime!
MRamanenkau Apr 17, 2023
a02ca0b
Merge branch 'feature/pallet-ddc-validator' into feature/integrate-un…
MRamanenkau Apr 17, 2023
78fd78d
Fix compilation errors after merge
MRamanenkau Apr 17, 2023
508dda3
Merge pull request #203 from Cerebellum-Network/feature/integrate-uni…
MRamanenkau Apr 17, 2023
0cb52b5
Add unit test example
MRamanenkau Apr 17, 2023
71d0d26
Fix build
MRamanenkau Apr 18, 2023
f38a1d2
Make data provider url configurable via rpc
MRamanenkau Apr 19, 2023
2d2ff2e
Fix local storage reading
khssnv Apr 19, 2023
16c8d24
Clean up
MRamanenkau Apr 19, 2023
5cb3e03
Merge pull request #209 from Cerebellum-Network/feature/data-model-url
MRamanenkau Apr 19, 2023
0cb0795
Remove duplicate parameter
khssnv Apr 20, 2023
2a488bc
Autoformat DAC Validator files
khssnv Apr 20, 2023
647e62f
Separate modules for validation and DAC client
khssnv Apr 20, 2023
1f52c80
Implement job assignment
MRamanenkau Apr 20, 2023
604441f
Compilation fixes
MRamanenkau Apr 20, 2023
a00acc6
Validation results with aggregates from DAC
khssnv Apr 21, 2023
fe6b5f4
Remove unnecessary validators signal reset call
khssnv Apr 21, 2023
f92657c
Remove an obsolete task manager related code
khssnv Apr 21, 2023
fcce6fe
Remove an obsolete ValidationResult related code
khssnv Apr 21, 2023
329c8e6
Use AccountId instead of String
MRamanenkau Apr 21, 2023
75c566b
Merge branch 'feature/pallet-ddc-validator' into feature/job-assgnment
MRamanenkau Apr 21, 2023
f468ece
Revert "Remove an obsolete ValidationResult related code"
MRamanenkau Apr 21, 2023
56e5fec
Revert "Remove an obsolete task manager related code"
MRamanenkau Apr 21, 2023
1541d3f
Revert "Remove unnecessary validators signal reset call"
MRamanenkau Apr 21, 2023
d36fe07
Merge branch 'feature/pallet-ddc-validator' into feature/job-assgnment
MRamanenkau Apr 21, 2023
3c71c21
Remove obsolete code
MRamanenkau Apr 21, 2023
5a39706
Merge pull request #211 from Cerebellum-Network/feature/job-assgnment
MRamanenkau Apr 21, 2023
80f4a2d
Try parse
MRamanenkau Apr 24, 2023
ccdeb10
Fix compilation error
MRamanenkau Apr 25, 2023
ada5d86
Fix parsing
MRamanenkau Apr 25, 2023
d3aece8
Update data format
MRamanenkau Apr 25, 2023
0951f89
Clean up
MRamanenkau Apr 25, 2023
d5a3f2c
Merge pull request #213 from Cerebellum-Network/parse-requst
MRamanenkau Apr 25, 2023
45c4a25
Remove obsolete create level docs
khssnv Apr 26, 2023
515628e
Autoformat DAC Validator files
khssnv Apr 26, 2023
c502f77
Move DAC interaction code to a separate module
khssnv Apr 26, 2023
5a3149f
Add DAC Validator utils module
khssnv Apr 26, 2023
762592c
Fix dac module usage in ddc-validator crate
khssnv Apr 26, 2023
6f300cc
Use log crate directly
khssnv Apr 27, 2023
368b910
Implement bytes aggregation
MRamanenkau Apr 27, 2023
8d785c0
Clean up code
MRamanenkau Apr 27, 2023
057fa53
Fix mock data url
MRamanenkau Apr 28, 2023
b68e32f
Fix info macro
MRamanenkau Apr 28, 2023
1b66843
DAC aggregates reading function
khssnv Apr 28, 2023
3102c84
Print the number of broken sessions by CDN node
khssnv Apr 28, 2023
7b1fdfe
Autoformat DAC Validator files
khssnv Apr 28, 2023
2c5b7ac
Add const for threshold configuration
MRamanenkau Apr 28, 2023
a6ef9af
DAC Validators' "shared memory" module
khssnv May 3, 2023
adfcae9
Borrow DAC data for validation, remove ownership
khssnv May 4, 2023
8626282
Make all DAC data types fields public
khssnv May 4, 2023
e77bb4d
Create intermediate validation decisions
khssnv May 4, 2023
09c27d9
Remove let...else unstable feature usage
khssnv May 4, 2023
5e7d85d
Base64 encoding func for validators' shared memory
khssnv May 5, 2023
3087509
A func to publish intermediate validation result
khssnv May 5, 2023
c4c5ccc
Reset validators launch signal each block
khssnv May 5, 2023
e57f82c
Publish intermediate validation results to shm
khssnv May 5, 2023
1c6e359
Implement validator decisions fetching
MRamanenkau May 4, 2023
3dd9e93
Fix shm save_validation_result_by_node request arg
khssnv May 10, 2023
e700623
Module docs for validators' shared memory mod
khssnv May 10, 2023
7e21d89
Payments module for DDC Validator pallet
khssnv May 10, 2023
311d8be
Reward points storage item in ddc-staking
khssnv May 11, 2023
8708dc0
Autoformat DDC Staking files
khssnv May 11, 2023
26b37ed
New call to payout to DDC stakers
khssnv May 11, 2023
775b1f1
Get final decision
MRamanenkau May 11, 2023
0f96a7f
Run cargo fmt
MRamanenkau May 11, 2023
25f9ac2
Replace FinalDecision wiht ValidationDecision
MRamanenkau May 11, 2023
a9907ef
Use u64 for DDC staker's reward points
khssnv May 11, 2023
fd2ebc9
A func to add reward points to CDN participants
khssnv May 11, 2023
b1495c9
New call to set reward points for CDN participants
khssnv May 11, 2023
cc18073
Error on staker duplicates in rewards points list
khssnv May 11, 2023
54d5931
Doc comment for the `set_era_reward_points` call
khssnv May 11, 2023
b7a7c11
Refer to a similar item in `pallet_staking`
khssnv May 11, 2023
04b4c71
Implement find_largest_group
MRamanenkau May 11, 2023
ffc6e91
Send tx
MRamanenkau May 12, 2023
92f7768
Cargo fmt
MRamanenkau May 12, 2023
cb89717
Put mocked era to get_validation_results
MRamanenkau May 12, 2023
18916d8
Merge pull request #216 from Cerebellum-Network/feature/post-final-on…
MRamanenkau May 12, 2023
5da383f
Make public `ddc_staking::EraRewardPoints` fields
khssnv May 12, 2023
94f0971
Add `set_era_reward_points` call to ddc-validator
khssnv May 12, 2023
7116ac8
Set era reward points from off-chain worker
khssnv May 12, 2023
9966d26
Prevent panic on redis shared memory comm error
khssnv May 15, 2023
38550b5
accounts first version
Raid5594 May 12, 2023
b77cb01
fix code quality
Raid5594 May 12, 2023
1b95ff9
add existential balance for pallet accounts
Raid5594 May 15, 2023
5e65bb2
Validate once per era
MRamanenkau May 15, 2023
8327f5f
Return early if no `dacv` key found, don't panic
khssnv May 16, 2023
6b0e30e
Use `log` crate in pallet-ddc-staking
khssnv May 17, 2023
644add6
Add `pallet-ddc-accounts` to workspace
khssnv May 17, 2023
7a085f8
Pass CDN payout source account to ddc-staking
khssnv May 17, 2023
f05d62c
Print CDN payout source account in debug log
khssnv May 17, 2023
a8cd20c
Don't panic in absence of `LastManagedEra` value
khssnv May 17, 2023
73e0371
Remove unused code from pallet-staking
MRamanenkau May 17, 2023
1e591a7
Implement payout to DDC stakers
khssnv May 17, 2023
74029a2
Remove unused code from pallet-staking
MRamanenkau May 17, 2023
085c080
Implement validate_edges
MRamanenkau May 16, 2023
02a6db4
Integrate job assignment
MRamanenkau May 17, 2023
cc7fd4c
Implement fetch and decode intermediate validation results
MRamanenkau May 17, 2023
90335ad
Integrate all parts
MRamanenkau May 18, 2023
1196f0d
Add more logs
MRamanenkau May 18, 2023
1b5a218
Clean up
MRamanenkau May 18, 2023
dbeb513
Merge pull request #218 from Cerebellum-Network/feature/integrate-dac…
MRamanenkau May 18, 2023
9a8021f
Get validator pubkey in another way
MRamanenkau May 19, 2023
6f134a5
Fix share_intermediate_validation_result
MRamanenkau May 19, 2023
7145ad5
Fix bugs
MRamanenkau May 19, 2023
408b928
Merge pull request #219 from Cerebellum-Network/feature/fix-integrati…
MRamanenkau May 22, 2023
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
10 changes: 10 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ members = [
"frame/ddc-metrics-offchain-worker",
"frame/ddc-pallet",
"frame/ddc-staking",
"frame/ddc-validator",
"frame/executive",
"frame/gilt",
"frame/grandpa",
Expand Down
19 changes: 19 additions & 0 deletions frame/ddc-validator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "pallet-ddc-validator"
version = "0.1.0"
edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }

[features]
default = ["std"]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
]
1 change: 1 addition & 0 deletions frame/ddc-validator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DDC Validator
26 changes: 26 additions & 0 deletions frame/ddc-validator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#![cfg_attr(not(feature = "std"), no_std)]

pub use frame_support::pallet_prelude::*;
pub use frame_system::pallet_prelude::*;
pub use pallet::*;

#[frame_support::pallet]
pub mod pallet {
use super::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
}

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {}

#[pallet::error]
pub enum Error<T> {}
}