diff --git a/README.md b/README.md index 9800c2a..edc0f7b 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,4 @@ This repo contains the following GitHub Actions workflows for CI: - [Documentation](./.github/workflows/node.md) See the pipeline documentation for more information. + diff --git a/src/block_conversion_plugin.cpp b/src/block_conversion_plugin.cpp index b5bca1a..64a13ad 100644 --- a/src/block_conversion_plugin.cpp +++ b/src/block_conversion_plugin.cpp @@ -40,13 +40,14 @@ class block_conversion_plugin_impl : std::enable_shared_from_this()){} - uint32_t timestamp_to_evm_block_num(uint64_t timestamp) const { - if (timestamp < bm.value().genesis_timestamp) { - SILK_CRIT << "Invalid timestamp " << timestamp << ", genesis: " << bm->genesis_timestamp; - assert(timestamp >= bm->genesis_timestamp); + uint32_t timestamp_to_evm_block_num(uint64_t timestamp_us) const { + uint64_t timestamp_s = timestamp_us / 1e6; + if (timestamp_s < bm.value().genesis_timestamp) { + SILK_CRIT << "Invalid timestamp " << timestamp_s << ", genesis: " << bm->genesis_timestamp; + assert(timestamp_s >= bm->genesis_timestamp); } - return bm->timestamp_to_evm_block_num(timestamp); + return bm->timestamp_to_evm_block_num(timestamp_us); } void load_head() {