Skip to content

Order transaction smart contract results and operations by execution - #1638

Merged
stefangutica merged 15 commits into
developmentfrom
transaction-sc-results-fix
Oct 7, 2026
Merged

stefangutica merged 15 commits into
developmentfrom
transaction-sc-results-fix

Conversation

@stefangutica

@stefangutica stefangutica commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Reasoning

  • Smart contract results did not expose timestampMs.
  • SCRs sharing a timestamp were ordered by uuid, which does not reflect execution.
  • operations came out in arbitrary order: events were not sorted by order, SCR operations were always placed before log operations, and trimOperations moved the sender's operations to the top.
  • The logs index is deprecated and removed.

Proposed Changes

  • Added timestampMs to SmartContractResult. When it is missing, it falls back to timestamp * 1000. Added nonce as a sort tie-breaker for SCRs.
  • Added the features.chainSupernova config (enabled, activationTimestampMs) and the scResultsOrderedByExecution query param on GET /transactions/:txHash, default false.
  • When the param is set, SCRs are sorted by their creation order on the source shard, using executionOrderTxsIndices. The indices are read from blocks before Supernova and from executionresults after.
  • Log events are read only from events, sorted by order in elastic.
  • Operations follow the order of the transaction and its SCRs. Removed the sender-first sort from trimOperations; deduplication is unchanged.
  • Removed the logs index path and elasticMigratedIndices.
  • Chain simulator e2e now uses a standalone multiversx/elastic-indexer container, so the executionresults index exists.

How to test

  • GET /transactions/2be7d7e40df1c7eb84c7dc2103669fce0b4639d92789c18c926f8d31fc4a5b3b?scResultsOrderedByExecution=true (post-Supernova): results and operations follow the swap flow, with cross-shard fee SCRs between the swaps.
  • GET /transactions/0e21b0d3dd439689a9c254168ce613aaa7acd424f4e0b8fcb4628fac99235c1d?scResultsOrderedByExecution=true (pre-Supernova): results follow the execution indices from blocks.
  • GET /transactions/ea9c62431d0eb7aecbf41467980c9ac086d645510e3e9714d3d3ff811b49926f: the sender's writeLog is the last operation.
  • Without the param, no extra elastic requests are made.

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

k6 load testing comparison.
Base Commit Hash: 8d8cb88
Target Commit Hash: 36dee95

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Mex63.581245.55109.74221.7140.361603.1054.4958.49-36.52% ✅+28.71% 🔴-50.34% ✅-73.62% ✅
Transactions218.5337153.27118.94139.4374.2815470.5166.1296.11-66.01% ✅-58.36% ✅-44.41% ✅-31.07% ✅
Accounts62.81702.86109.01221.5642.71709.2057.7670.97-32.00% ✅+0.90% 🔴-47.01% ✅-67.97% ✅
Blocks86.05853.46217.33308.2551.172726.9157.3064.00-40.54% ✅+219.51% 🔴-73.63% ✅-79.24% ✅
Nodes3963.4538690.9314989.1738688.7966.5915858.8858.4974.03-98.32% ✅-59.01% ✅-99.61% ✅-99.81% ✅
Tokens276.181566.04710.191564.6940.722663.7853.6858.10-85.26% ✅+70.10% 🔴-92.44% ✅-96.29% ✅
Pool63.761477.21113.05222.7240.632640.5553.6557.96-36.28% ✅+78.75% 🔴-52.55% ✅-73.98% ✅
Test Run Duration60002.5860005.90

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

@stefangutica stefangutica changed the title Transaction sc results fix Order transaction smart contract results and operations by execution Oct 6, 2026
@stefangutica
stefangutica merged commit b40c3c4 into development Oct 7, 2026
6 checks passed
@stefangutica
stefangutica deleted the transaction-sc-results-fix branch October 7, 2026 10:47
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.

3 participants