braiins / bos-plus-api

BOS API
22 stars 9 forks source link

uint32 Quota vs double FixedShareRatio #21

Open average-gary opened 7 months ago

average-gary commented 7 months ago

Using Rust and using tonic::include_proto!("braiins.bos.v1");

Trying to generalize some ASIC configuration and go from FixedShareRatio into a general Quota by multiplying by 100 and such. Find this for f64 to u64 but Quota is u32, however other 64bit types are defined elsewhere, so I assume 64bit unsigned integers would be allowable.

Not really sure if this is an issue or not but seems like a general inconsistency.

proto/bos/v1/pool.proto

// Structure for quota load balance strategy
message Quota {
  uint32 value = 1;
}

// Structure for fixed share ratio load balance strategy
// Fixed share ratio is value between 0.0 to 1.0 where 1.0 represents that all work is
// generated from the group
message FixedShareRatio {
  double value = 1;
}