use ratios instead of percentages in campaign mix
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Bắt đầu từ các định nghĩa campaign được liên kết trong issue và tìm kiếm CampaignMixEntry, ResolvedMixEntry và share_pct để tìm mọi điểm vào bị ảnh hưởng. Theo dõi cách các mix rate được tính toán, sau đó xác minh rằng các đầu vào dựa trên tỷ lệ phân bổ total rate như mô tả và sử dụng số nguyên không dấu trong toàn bộ quá trình; issue lưu ý rằng việc làm tròn có thể để lại một phần dư nhỏ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
Regarding campaign definitions, mix_pct (percentage) forces the user to manually sum up each mix's percentage to get the right ratio, which can be error-prone and tedious in campaigns with lots of mixes.
Describe the solution you'd like
Use ratios instead.
- in
CampaignMixEntryandResolvedMixEntry, changeshare_pcttoratio - use unsigned ints instead of signed
Example:
mix_ratio_A = 2
mix_ratio_B = 1
total_tps = 100
Mix A would then produce 67 tps, and Mix B would produce 33, because A ≈ 2B.
Example:
mix_ratio_A = 1
mix_ratio_B = 1
mix_ratio_C = 1
mix_ratio_D = 1
total_tps = 100
Each mix would produce 25 tps.
Here's how I'd work out the final rate of each mix_ratio $\large m_i$ given total spam rate (tps/tpb) $\large t$:
$$\Large spamRate(m_i) = \frac{t * m_i}{\sum_{k=1}^n m_k}$$
or in code:
fn mix_spam_rate(ratio: u64, ratios: &[u64], total_rate: u64) -> u64 {
(total_rate * ratio) / ratios.iter().sum::<u64>()
}
Using unsigned ints in this formula sometimes creates conditions where the sum of the individual rates doesn't meet the total desired rate (e.g. you get 99 tps instead of 100 because of a round-down), but it gets close enough.
Using floating point integers at the intake (CampaignMixEntry) could solve this (allowing us to round more intelligently before casting to unsigned) but not sure it's worth the effort. Users can always just increase the total_rate a little bit to compensate if they need to exactly hit the target spam rate.
- Ngôn ngữ chính
- Rust
- Star
- 144
- Fork
- 58
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flashbots/contender
-
engine_newPayload filesĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
-
server: generate reportsĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
server: export DB from sessionCó thể làm lại được @zeroXbrock đã nhận 203 ngày trước và không có pull request nào đang mở. Đang mởenhancement help wanted question
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
Tất cả issue của flashbots/contender
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
open-telemetry/weaver#1917 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug host P3 web
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jphacks/kz_2613#589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation pkg:sdk project
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
priority middle
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
KATO-Hiro/AtCoderClans#13029 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RustCrypto/formats#2544 ·
Maintainer thường phản hồi trong vòng 1 ngày