rippled icon indicating copy to clipboard operation
rippled copied to clipboard

Fix `PriceDataSeries` order on `PriceOracle` creation

Open tequdev opened this issue 6 months ago • 1 comments

High Level Overview of Change

Fixed an issue where the order of PriceDataSeries was out of sync between when PriceOracle was created and when it was updated.

Context of Change

Although they are registered in the canonical order when updated, they are created using the order specified in the transaction, so change so that they are also registered in the canonical order when created.

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)

API Impact

no

Examples of data with issues

{
   "AffectedNodes" : [
      {
         "ModifiedNode" : {
            "FinalFields" : {
               "Account" : "rwhaYGnJMexktjhxAKzRwoCcQ2g6hvBDWu",
               "Balance" : "999999980",
               "Flags" : 8388608,
               "OwnerCount" : 1,
               "Sequence" : 6
            },
            "LedgerEntryType" : "AccountRoot",
            "LedgerIndex" : "2D6FE275B8B62F3B2C743090152CA05B8A28D5D20BEBED3A4B26745881180462",
            "PreviousFields" : {
               "Balance" : "999999990",
               "Sequence" : 5
            },
            "PreviousTxnID" : "18F8010465F8ABBE5A6DDF05E2AC5E9F28F7BA2B574FD1112B7B57C188E79F87",
            "PreviousTxnLgrSeq" : 4
         }
      },
      {
         "ModifiedNode" : {
            "FinalFields" : {
               "AssetClass" : "63757272656E6379",
               "Flags" : 0,
               "LastUpdateTime" : 946694820,
               "Owner" : "rwhaYGnJMexktjhxAKzRwoCcQ2g6hvBDWu",
               "OwnerNode" : "0",
               "PriceDataSeries" : [
                  {
                     "PriceData" : {
                        "AssetPrice" : "2c7",
                        "BaseAsset" : "XRP",
                        "QuoteAsset" : "EUR",
                        "Scale" : 2
                     }
                  },
                  {
                     "PriceData" : {
                        "AssetPrice" : "2e6",
                        "BaseAsset" : "XRP",
                        "QuoteAsset" : "USD",
                        "Scale" : 2
                     }
                  }
               ],
               "Provider" : "70726F7669646572",
               "URI" : "555249"
            },
            "LedgerEntryType" : "Oracle",
            "LedgerIndex" : "72CD5C8AE42E0A993C1234E95B0F8A3BC7CADBD7097ACB23CC7B6DBFB06AA101",
            "PreviousFields" : {
               "LastUpdateTime" : 946694810,
               "PriceDataSeries" : [
                  {
                     "PriceData" : {
                        "AssetPrice" : "2e6",
                        "BaseAsset" : "XRP",
                        "QuoteAsset" : "USD",
                        "Scale" : 2
                     }
                  },
                  {
                     "PriceData" : {
                        "AssetPrice" : "2c7",
                        "BaseAsset" : "XRP",
                        "QuoteAsset" : "EUR",
                        "Scale" : 2
                     }
                  }
               ]
            },
            "PreviousTxnID" : "18F8010465F8ABBE5A6DDF05E2AC5E9F28F7BA2B574FD1112B7B57C188E79F87",
            "PreviousTxnLgrSeq" : 4
         }
      }
   ],
   "TransactionIndex" : 0,
   "TransactionResult" : "tesSUCCESS"
}

tequdev avatar Jun 10 '25 08:06 tequdev

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 78.8%. Comparing base (b5a63b3) to head (4f89615). :warning: Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5485   +/-   ##
=======================================
  Coverage     78.8%   78.8%           
=======================================
  Files          814     814           
  Lines        71267   71284   +17     
  Branches      8370    8343   -27     
=======================================
+ Hits         56133   56181   +48     
+ Misses       15134   15103   -31     
Files with missing lines Coverage Δ
src/xrpld/app/tx/detail/SetOracle.cpp 100.0% <100.0%> (ø)

... and 8 files with indirect coverage changes

Impacted file tree graph

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 10 '25 08:06 codecov[bot]

@tequdev is this ready to merge?

bthomee avatar Aug 05 '25 15:08 bthomee

@tequdev is this ready to merge?

yes

tequdev avatar Aug 05 '25 15:08 tequdev

@tequdev can you please amend your very first commit and sign it?

bthomee avatar Aug 05 '25 15:08 bthomee

an you please amend your very first commit and sign it?

Approval has already been given, but is it okay if a force push occurs due to rebasing/squashing?

tequdev avatar Aug 05 '25 15:08 tequdev

an you please amend your very first commit and sign it?

Approval has already been given, but is it okay if a force push occurs due to rebasing/squashing?

Yes, please go ahead. Another approval might be needed but that's easy to give.

bthomee avatar Aug 05 '25 15:08 bthomee

@bthomee Could you rerun the macOS workflow? I have no permission to do it.

something went wrong when it was executed.

tequdev avatar Aug 05 '25 16:08 tequdev

@bthomee Could you rerun the macOS workflow? I have no permission to do it.

something went wrong when it was executed.

Yes, there are some interesting concurrency issues with how the Conan remotes are removed and re-added. A few PRs are opened that will optimize the CI pipelines. I'll keep retrying until it succeeds.

bthomee avatar Aug 05 '25 16:08 bthomee

@tequdev would you like to create a new PR to switch Supported::no to yes for this amendment, before the 3.0.0 release ?

Bronek avatar Sep 01 '25 10:09 Bronek

@tequdev would you like to create a new PR to switch Supported::no to yes for this amendment, before the 3.0.0 release ?

created https://github.com/XRPLF/rippled/pull/5749

tequdev avatar Sep 01 '25 10:09 tequdev