harmony icon indicating copy to clipboard operation
harmony copied to clipboard

eth_call returns unexpected output

Open jinhoonbang opened this issue 3 years ago • 5 comments
trafficstars

Describe the bug eth_call returns unexpected value. fulfillRandomWords function is expected to return Uint96 (contract). However, Harmony RPC returns a value that is bigger than Uint96.

client: go-ethereum

Example

eth_call calldata:
{
  "name": "fulfillRandomWords",
  "params": [
    {
      "name": "proof",
      "value": [
        [
          "24557253095494019804321386178925434115837429356373578479230425203211594328106",
          "89236867270774633094463604055629145038619210405378692716304592223880407849012"
        ],
        [
          "3523647270145078042421116301308984442069816990573206970405290042690347713866",
          "58319817223002269792977765282057428142845863093009540932300761580746474644503"
        ],
        "34832697757140520079689341423610947887949335473423390749618954742287360738232",
        "103036806529058171232421876157951628276942911643526591622891322675837421963275",
        "97460335396448374431833100501596664903726295224475187740127175987879130471855",
        "0xb2D5059d03ABc21a027a555b703D849C4327B760",
        [
          "27665571681741137842343593655507182645268108824187530700388115351878541301629",
          "71724968165280040484538204229243881061603804033609136063037677779304494320625"
        ],
        [
          "84050433626849341498484122228402656266710391862484844089842542869315725488948",
          "12161622873752866866765511682436986409002197204786432077813539995963206472908"
        ],
        "69955939925668567250374003671671216097043744021739444089337292262869313799603"
      ],
      "type": "tuple"
    },
    {
      "name": "rc",
      "value": [
        "26983456",
        "1",
        "1000000",
        "1",
        "0x1CF42D5460b95CF8c54190dd915b83dEaD0aB455"
      ],
      "type": "tuple"
    }
  ]
}

Return Value Hex: 0x77f5b84cbe5d5275a147a194a6bee50d0ea96831913bd1464adca50777be4bc0a1a79a25
Return Value Dec: 233042256169999207914763389000179351583806630621549339286479625773556283552204128229925
Uint96 Max Value (2^96 - 1): 79228163000000000000000000000

jinhoonbang avatar May 26 '22 15:05 jinhoonbang

currently, eth_call on harmony would return a wrong value if the call is reverted. this pr #4179 fixed this issue.

peekpi avatar May 30 '22 08:05 peekpi

Thanks @peekpi . How long does it usually take for RPC providers (e.g. ChainStack, SimplyVC) to pick up new changes?

jinhoonbang avatar May 31 '22 14:05 jinhoonbang

Alternatively, are there any public RPC endpoints where this change is available?

jinhoonbang avatar May 31 '22 18:05 jinhoonbang

Alternatively, are there any public RPC endpoints where this change is available?

@sophoah do you know about this?

peekpi avatar Jun 03 '22 08:06 peekpi

The PR will be deployed along with the 4.3.10 release.

LeoHChen avatar Jun 07 '22 17:06 LeoHChen

#4179

MaxMustermann2 avatar Jun 22 '23 16:06 MaxMustermann2