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: IC-1680: Add NPR computation V1 in ic-registry-node-provider-rewards lib #2655

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8755022
Add compute rewards v1
pietrodimarco-dfinity Nov 18, 2024
9953d89
Add v1 modules
pietrodimarco-dfinity Nov 18, 2024
25257bf
Fix bazel run
pietrodimarco-dfinity Nov 18, 2024
c5424dd
Fix bazel dep
pietrodimarco-dfinity Nov 18, 2024
64a24f2
Fix bazel
pietrodimarco-dfinity Nov 18, 2024
97357fa
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Nov 18, 2024
5b1cf8d
Fix bazel
pietrodimarco-dfinity Nov 18, 2024
fc54dd2
Fix bazel
pietrodimarco-dfinity Nov 18, 2024
46d5949
Use standard HashMap and create new logger each NP
pietrodimarco-dfinity Nov 28, 2024
5970911
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Nov 28, 2024
9fab059
Automatically updated Cargo*.lock
Nov 28, 2024
58c0e88
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Nov 28, 2024
3e406a6
Add systemic FR from subnet
pietrodimarco-dfinity Dec 9, 2024
843a522
Adjust logs and add comments
pietrodimarco-dfinity Dec 10, 2024
b1ed776
Fix typos
pietrodimarco-dfinity Dec 10, 2024
8bca036
Remove unused dependencies
pietrodimarco-dfinity Dec 10, 2024
186fee3
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Dec 10, 2024
6d79176
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Dec 10, 2024
dc7ea10
Automatically updated Cargo*.lock
Dec 10, 2024
a6ad2cc
Fixed clippy
pietrodimarco-dfinity Dec 10, 2024
f1e8f95
Merge remote-tracking branch 'origin/pmarco/add-npr-lib-v1' into pmar…
pietrodimarco-dfinity Dec 10, 2024
db8ebf6
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Dec 10, 2024
5806cce
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Dec 11, 2024
bc2c3a7
Fix log displaying
pietrodimarco-dfinity Dec 11, 2024
0ef1c3e
Additional whitespaces for logs
pietrodimarco-dfinity Dec 11, 2024
318cabb
Fixed comments
pietrodimarco-dfinity Jan 15, 2025
cc0690a
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Jan 15, 2025
17625df
Automatically updated Cargo*.lock
Jan 15, 2025
d62d8d8
Remove useless into()
pietrodimarco-dfinity Jan 15, 2025
8f5584f
Merge branch 'master' into pmarco/add-npr-lib-v1
pietrodimarco-dfinity Jan 15, 2025
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
2 changes: 1 addition & 1 deletion Cargo.Bazel.Fuzzing.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "12851c6ba4c9f6ac1c749cc7ff0dbfe30e4f2dda7951663e4a4cc64d29fdee95",
"checksum": "9f2df98d8d1fd926a31c157d4a1d531a4ea2743880bc4d424878a2c12e1806fb",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down
159 changes: 144 additions & 15 deletions Cargo.Bazel.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "3ae1d8f974c70715eb6c96b5461fb094433a0ac382617ef84fa0efbfb2a8feef",
"checksum": "8937cce18e46d622f1599c306222ba267f9eb27f581e612982bb27d87bf4cf0d",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -1469,6 +1469,8 @@
],
"crate_features": {
"common": [
"compile-time-rng",
"const-random",
"default",
"getrandom",
"runtime-rng",
Expand All @@ -1486,6 +1488,10 @@
"id": "cfg-if 1.0.0",
"target": "cfg_if"
},
{
"id": "const-random 0.1.18",
"target": "const_random"
},
{
"id": "getrandom 0.2.10",
"target": "getrandom"
Expand Down Expand Up @@ -13467,6 +13473,110 @@
],
"license_file": "LICENSE-APACHE"
},
"const-random 0.1.18": {
"name": "const-random",
"version": "0.1.18",
"package_url": "https://github.com/tkaitchuck/constrandom",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/const-random/0.1.18/download",
"sha256": "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
}
},
"targets": [
{
"Library": {
"crate_name": "const_random",
"crate_root": "src/lib.rs",
"srcs": {
"allow_empty": true,
"include": [
"**/*.rs"
]
}
}
}
],
"library_target_name": "const_random",
"common_attrs": {
"compile_data_glob": [
"**"
],
"edition": "2018",
"proc_macro_deps": {
"common": [
{
"id": "const-random-macro 0.1.16",
"target": "const_random_macro"
}
],
"selects": {}
},
"version": "0.1.18"
},
"license": "MIT OR Apache-2.0",
"license_ids": [
"Apache-2.0",
"MIT"
],
"license_file": "LICENSE-APACHE"
},
"const-random-macro 0.1.16": {
"name": "const-random-macro",
"version": "0.1.16",
"package_url": "https://github.com/tkaitchuck/constrandom",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/const-random-macro/0.1.16/download",
"sha256": "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
}
},
"targets": [
{
"ProcMacro": {
"crate_name": "const_random_macro",
"crate_root": "src/lib.rs",
"srcs": {
"allow_empty": true,
"include": [
"**/*.rs"
]
}
}
}
],
"library_target_name": "const_random_macro",
"common_attrs": {
"compile_data_glob": [
"**"
],
"deps": {
"common": [
{
"id": "getrandom 0.2.10",
"target": "getrandom"
},
{
"id": "once_cell 1.19.0",
"target": "once_cell"
},
{
"id": "tiny-keccak 2.0.2",
"target": "tiny_keccak"
}
],
"selects": {}
},
"edition": "2018",
"version": "0.1.16"
},
"license": "MIT OR Apache-2.0",
"license_ids": [
"Apache-2.0",
"MIT"
],
"license_file": "LICENSE-APACHE"
},
"convert_case 0.4.0": {
"name": "convert_case",
"version": "0.4.0",
Expand Down Expand Up @@ -18116,6 +18226,10 @@
"id": "addr 0.15.6",
"target": "addr"
},
{
"id": "ahash 0.8.11",
"target": "ahash"
},
{
"id": "aide 0.13.4",
"target": "aide"
Expand Down Expand Up @@ -71517,46 +71631,60 @@
],
"selects": {
"aarch64-apple-darwin": [
"sha3"
"sha3",
"shake"
],
"aarch64-pc-windows-msvc": [
"sha3"
"sha3",
"shake"
],
"aarch64-unknown-linux-gnu": [
"sha3"
"sha3",
"shake"
],
"aarch64-unknown-nixos-gnu": [
"sha3"
"sha3",
"shake"
],
"arm-unknown-linux-gnueabi": [
"sha3"
"sha3",
"shake"
],
"i686-pc-windows-msvc": [
"sha3"
"sha3",
"shake"
],
"i686-unknown-linux-gnu": [
"sha3"
"sha3",
"shake"
],
"powerpc-unknown-linux-gnu": [
"sha3"
"sha3",
"shake"
],
"s390x-unknown-linux-gnu": [
"sha3"
"sha3",
"shake"
],
"x86_64-apple-darwin": [
"sha3"
"sha3",
"shake"
],
"x86_64-pc-windows-msvc": [
"sha3"
"sha3",
"shake"
],
"x86_64-unknown-freebsd": [
"sha3"
"sha3",
"shake"
],
"x86_64-unknown-linux-gnu": [
"sha3"
"sha3",
"shake"
],
"x86_64-unknown-nixos-gnu": [
"sha3"
"sha3",
"shake"
]
}
},
Expand Down Expand Up @@ -86137,6 +86265,7 @@
"actix-rt 2.10.0",
"actix-web 4.9.0",
"addr 0.15.6",
"ahash 0.8.11",
"aide 0.13.4",
"anyhow 1.0.93",
"arbitrary 1.3.2",
Expand Down
22 changes: 22 additions & 0 deletions Cargo.Bazel.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
dependencies = [
"cfg-if 1.0.0",
"const-random",
"getrandom",
"once_cell",
"version_check",
Expand Down Expand Up @@ -2231,6 +2232,26 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747"

[[package]]
name = "const-random"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
dependencies = [
"const-random-macro",
]

[[package]]
name = "const-random-macro"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
dependencies = [
"getrandom",
"once_cell",
"tiny-keccak",
]

[[package]]
name = "convert_case"
version = "0.4.0"
Expand Down Expand Up @@ -2947,6 +2968,7 @@ dependencies = [
"actix-rt",
"actix-web",
"addr",
"ahash 0.8.11",
"aide",
"anyhow",
"arbitrary",
Expand Down
30 changes: 30 additions & 0 deletions Cargo.lock

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

7 changes: 7 additions & 0 deletions bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
"idna",
],
),
"ahash": crate.spec(
version = "^0.8.11",
default_features = False,
features = [
"compile-time-rng",
],
),
"aide": crate.spec(
version = "^0.13.4",
features = [
Expand Down
15 changes: 12 additions & 3 deletions rs/registry/node_provider_rewards/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@ package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
"//rs/types/base_types",
"//rs/types/management_canister_types",
"//rs/protobuf",
"@crate_index//:ahash",
"@crate_index//:num-traits",
"@crate_index//:itertools",
"@crate_index//:lazy_static",
"@crate_index//:rust_decimal",
"@crate_index//:serde",
"@crate_index//:candid",
]

DEV_DEPENDENCIES = [
"@crate_index//:maplit",
MACRO_DEPENDENCIES = [
"@crate_index//:rust_decimal_macros",
]

rust_library(
name = "node_provider_rewards",
srcs = glob(["src/**/*.rs"]),
crate_name = "ic_registry_node_provider_rewards",
proc_macro_deps = MACRO_DEPENDENCIES,
version = "0.9.0",
deps = DEPENDENCIES,
)

rust_test(
name = "node_provider_rewards_test",
crate = ":node_provider_rewards",
deps = DEPENDENCIES + DEV_DEPENDENCIES,
deps = DEPENDENCIES,
)
Loading