NethermindEth / blockifier-tester

A testing utility to run juno with our version of the blockifier that uses cairo native, and compare it to results from mainnet or from juno using the unmodified blockifier
1 stars 1 forks source link

fix: exclude duplicate calls for class hash and entry points #88

Closed marcuspang closed 5 days ago

marcuspang commented 1 week ago

Fixes #85

Changes

  1. get_calls_with_count now returns a HashMap<(EntryPoint, ClassHash), usize>
    • this was previously called get_calls, which returned a list of possible tuple values, but I chose to return the concrete (EntryPoint, ClassHash) pairs instead for clarity
  2. updated call Value parsing, which can now parse keys that have "Same(0x123)" values
    • previously, the function could only parse from "0x123" values, which meant that the parsing of some calls terminated early because of the "Same" prefix
  3. update unit tests for get_calls_with_count and added some for helper functions

Notes

rodrigo-pino commented 1 week ago

How should conflicting calls be handled? If base has [(ch1, ep1), (ch2, ep2)] and native has [(ch1, ep1)], do we return a count of 1 or 2 for (ch1, ep1) (currently taking the sum in merge_calls_with_count)

A count of 1 for (ch1, ep1). We ignore (ch2, ep2) since there is no data

rodrigo-pino commented 1 week ago

If (ch1, ep1) and (ch1, ep2) that's a different Pair and cannot be compared. You can only compare "same keys" like when (ch_i, ep_k) exists in both.