Skip to content

Commit

Permalink
fix: use cpp17 instead of cpp23 to facilitate the build
Browse files Browse the repository at this point in the history
  • Loading branch information
aimxhaisse committed Jun 25, 2024
1 parent 40537f7 commit d8f8177
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def build(setup_kwargs):
],
extra_compile_args=['-O3', '-pthread'],
language='c++',
cxx_std=23
cxx_std=17
)
]
setup_kwargs.update({
Expand Down
2 changes: 1 addition & 1 deletion eth_validator_watcher/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ def maybe_wait_for_slot(self, slot: int) -> None:
target = self._genesis + slot * self._slot_duration + self._lag_seconds
now = self.now()
if now < target:
logging.info(f'⏳Waiting {target - now:.2f} seconds for slot {slot}')
logging.info(f'⏳Waiting {target - now:.2f} seconds for slot {slot}')
time.sleep(target - now)
11 changes: 6 additions & 5 deletions eth_validator_watcher/mod.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <iostream>
#include <stdfloat>
#include <vector>
#include <thread>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

using float64_t = double;

// Flat structure to allow stupid simple conversions to Python without
// having too-many levels of mental indirections. Processing is shared
// between python (convenience) and cpp (fast).
Expand All @@ -20,8 +21,8 @@ struct Validator {
bool suboptimal_source = false;
bool suboptimal_target = false;
bool suboptimal_head = false;
std::float64_t ideal_consensus_reward = 0;
std::float64_t actual_consensus_reward = 0;
float64_t ideal_consensus_reward = 0;
float64_t actual_consensus_reward = 0;

// Updated data from the blocks processing
std::vector<uint64_t> missed_blocks;
Expand Down Expand Up @@ -51,8 +52,8 @@ struct MetricsByLabel {
uint64_t optimal_head_count = 0;
uint64_t validator_slashes = 0;

std::float64_t ideal_consensus_reward = 0;
std::float64_t actual_consensus_reward = 0;
float64_t ideal_consensus_reward = 0;
float64_t actual_consensus_reward = 0;
uint64_t missed_attestations = 0;
uint64_t missed_consecutive_attestations = 0;

Expand Down

0 comments on commit d8f8177

Please sign in to comment.