Skip to content

fix elastic searching#1592

Open
stefangutica wants to merge 2 commits intodevelopmentfrom
fix-elastic-searching-timeframe
Open

fix elastic searching#1592
stefangutica wants to merge 2 commits intodevelopmentfrom
fix-elastic-searching-timeframe

Conversation

@stefangutica
Copy link
Collaborator

Reasoning

  • We found an edge case in transactions timeframe filtering when combining after and before across legacy and modern data.
  • Specifically, if after pointed to an older period (legacy docs using timestamp) and before pointed to a newer period (docs using timestampMs), queries could miss results when the dataset in that interval contained only documents without timestampMs.
  • In that scenario, legacy documents were unintentionally excluded because the mixed condition favored the modern path in a way that did not consistently preserve fallback behavior.

Proposed Changes

  • Normalize timeframe filtering to first query by timestampMs when present.
  • Keep explicit fallback to timestamp for documents that do not have timestampMs.
  • Apply the same priority/fallback approach consistently so mixed historical ranges return both modern and legacy documents correctly.

How to test

  • Query a range that includes mixed data (documents with and without timestampMs) and verify results are still returned correctly.
  • Validate ordering for block lookup: records with timestampMs should be sorted by timestampMs, with legacy records correctly ordered via timestamp.
  • Run the existing lint/type checks (or targeted tests for indexer queries) and confirm no regressions.

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

k6 load testing comparison.
Base Commit Hash: 58eae3e
Target Commit Hash: d9020a5

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Accounts107.211278.21113.33119.8465.191013.3966.6769.26-39.20% ✅-20.72% ✅-41.17% ✅-42.20% ✅
Blocks83.471466.5891.8195.0072.27766.3967.3892.13-13.42% ✅-47.74% ✅-26.61% ✅-3.02% ✅
Mex53.571172.2056.1358.3963.231186.8066.3069.26+18.01% 🔴+1.25% 🔴+18.14% 🔴+18.60% 🔴
Pool53.42397.9056.1858.4762.52651.3066.3169.18+17.04% 🔴+63.69% 🔴+18.03% 🔴+18.32% 🔴
Nodes54.091250.4556.2558.5062.08457.8166.3169.03+14.77% 🔴-63.39% ✅+17.88% 🔴+18.00% 🔴
Transactions107.441281.38112.86118.9580.473372.4567.4878.42-25.10% ✅+163.19% 🔴-40.21% ✅-34.08% ✅
Tokens53.48397.9256.2958.7563.101206.0466.3769.15+18.00% 🔴+203.08% 🔴+17.92% 🔴+17.70% 🔴
Test Run Duration60007.4960001.99

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants