Skip to content

Commit

Permalink
Add rewards computation and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrodimarco-dfinity committed Nov 6, 2024
1 parent b8b65e2 commit 7a255e3
Show file tree
Hide file tree
Showing 10 changed files with 946 additions and 23 deletions.
78 changes: 75 additions & 3 deletions Cargo.Bazel.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "b9a098cf38a25d6eabe74b8d704b6ddcb5aebfdf40cb01dd1a81b2376028b32e",
"checksum": "3799cff98dde0d30c14cdff202327ee9438081ac25593f99168d4fadc1dad52b",
"crates": {
"actix-codec 0.5.2": {
"name": "actix-codec",
Expand Down Expand Up @@ -28084,29 +28084,35 @@
],
"crate_features": {
"common": [
"elf",
"errno",
"general",
"ioctl",
"no_std"
],
"selects": {
"aarch64-unknown-linux-gnu": [
"elf",
"errno",
"prctl",
"std",
"system"
],
"arm-unknown-linux-gnueabi": [
"elf",
"errno",
"prctl",
"std",
"system"
],
"armv7-unknown-linux-gnueabi": [
"elf",
"errno",
"prctl",
"std",
"system"
],
"i686-unknown-linux-gnu": [
"elf",
"errno",
"prctl",
"std",
"system"
Expand All @@ -28122,6 +28128,8 @@
"system"
],
"x86_64-unknown-linux-gnu": [
"elf",
"errno",
"prctl",
"std",
"system"
Expand Down Expand Up @@ -29575,6 +29583,69 @@
},
"license": "MIT"
},
"node-provider-rewards-lib 0.5.6": {
"name": "node-provider-rewards-lib",
"version": "0.5.6",
"repository": null,
"targets": [
{
"Library": {
"crate_name": "node_provider_rewards_lib",
"crate_root": "src/lib.rs",
"srcs": [
"**/*.rs"
]
}
}
],
"library_target_name": "node_provider_rewards_lib",
"common_attrs": {
"compile_data_glob": [
"**"
],
"deps": {
"common": [
{
"id": "ic-base-types 0.9.0",
"target": "ic_base_types"
},
{
"id": "ic-protobuf 0.9.0",
"target": "ic_protobuf"
},
{
"id": "itertools 0.13.0",
"target": "itertools"
},
{
"id": "lazy_static 1.5.0",
"target": "lazy_static"
},
{
"id": "num-traits 0.2.19",
"target": "num_traits"
},
{
"id": "rust_decimal 1.36.0",
"target": "rust_decimal"
}
],
"selects": {}
},
"edition": "2021",
"proc_macro_deps": {
"common": [
{
"id": "rust_decimal_macros 1.36.0",
"target": "rust_decimal_macros"
}
],
"selects": {}
},
"version": "0.5.6"
},
"license": null
},
"node-status-updater 0.5.6": {
"name": "node-status-updater",
"version": "0.5.6",
Expand Down Expand Up @@ -48600,6 +48671,7 @@
"multiservice-discovery 0.5.6": "rs/ic-observability/multiservice-discovery",
"multiservice-discovery-downloader 0.5.6": "rs/ic-observability/multiservice-discovery-downloader",
"multiservice-discovery-shared 0.5.6": "rs/ic-observability/multiservice-discovery-shared",
"node-provider-rewards-lib 0.5.6": "rs/dre-canisters/node-provider-rewards-lib",
"node-status-updater 0.5.6": "rs/ic-observability/node-status-updater",
"obs-canister-clients 0.5.6": "rs/ic-observability/obs-canister-clients",
"prometheus-config-updater 0.5.6": "rs/ic-observability/prometheus-config-updater",
Expand Down
53 changes: 33 additions & 20 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 @@ -19,6 +19,7 @@ members = [
"rs/log-fetcher",
"rs/canister-log-fetcher",
"rs/slack-notifications",
"rs/dre-canisters/node-provider-rewards-lib",
"rs/dre-canisters/trustworthy-node-metrics/src/trustworthy-node-metrics",
"rs/dre-canisters/trustworthy-node-metrics/src/trustworthy-node-metrics-types",
]
Expand Down
1 change: 1 addition & 0 deletions bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def external_crates_repository():
"//rs/ic-observability/sns-downloader:Cargo.toml",
"//rs/log-fetcher:Cargo.toml",
"//rs/slack-notifications:Cargo.toml",
"//rs/dre-canisters/node-provider-rewards-lib:Cargo.toml",
"//rs/dre-canisters/trustworthy-node-metrics/src/trustworthy-node-metrics:Cargo.toml",
"//rs/dre-canisters/trustworthy-node-metrics/src/trustworthy-node-metrics-types:Cargo.toml",
],
Expand Down
31 changes: 31 additions & 0 deletions rs/dre-canisters/node-provider-rewards-lib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
load("@crate_index_dre//:defs.bzl", "aliases", "all_crate_deps")
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "node-provider-rewards-lib",
srcs = glob(["src/**/*.rs"]),
aliases = aliases(),
proc_macro_deps = all_crate_deps(
proc_macro = True,
),
deps = all_crate_deps(
normal = True,
),
)

rust_test(
name = "unit_test",
aliases = aliases(
normal_dev = True,
proc_macro_dev = True,
),
crate = ":node-provider-rewards-lib",
proc_macro_deps = all_crate_deps(
proc_macro_dev = True,
),
deps = all_crate_deps(
normal_dev = True,
),
)
20 changes: 20 additions & 0 deletions rs/dre-canisters/node-provider-rewards-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "node-provider-rewards-lib"
version.workspace = true
authors.workspace = true
description.workspace = true
documentation.workspace = true
edition.workspace = true

[dependencies]
ic-base-types = { workspace = true }
ic-protobuf = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
num-traits = { workspace = true }
rust_decimal = { workspace = true }
rust_decimal_macros = { workspace = true }

[lib]
name = "node_provider_rewards_lib"
path = "src/lib.rs"
3 changes: 3 additions & 0 deletions rs/dre-canisters/node-provider-rewards-lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod v1_logs;
pub mod v1_rewards;
pub mod v1_types;
Loading

0 comments on commit 7a255e3

Please sign in to comment.