Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add trace filter API #12123

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft

feat: Add trace filter API #12123

wants to merge 20 commits into from

Conversation

snissn
Copy link
Contributor

@snissn snissn commented Jun 20, 2024

Proposed Changes

  • Add json RPC support for trace_filter to lotus

  • This code assumes that FromBlock and ToBlock and both provided. These are used to iterate through blocks and a filter is applied.

  • The spec lists FromBlock and ToBlock as optional but i think in practice most use cases include will them. I'm not sure how to implement this function without a block range because of the way the data is organized.

TODO:

  • Implement support for blocks specified by "Latest"

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

Testing

  • Use curl to verify the accuracy of the api endpoint
$ curl -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "Filecoin.EthTraceFilter",
    "params": [{
      "fromBlock": "0x1A34D6",
      "toBlock": "0x1A34D7"
    }],
    "id": 1
  }' \
  http://127.0.0.1:1234/rpc/v1
{"id":1,"jsonrpc":"2.0","result":[{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0x949057ee441110ff12ab10136a4db45aa4e66daa","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x588145c","value":"0x68155a43676e00000","input":"0xb6b55f2500000000000000000000000000000000000000000000000680396ca2f8d80000"},"result":{"gasUsed":"0x170250b","output":"0x000000000000000000000000000000000000000000000006804bcd8948d9a46a"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0982f5e6e633300b9ec43c3c4886e2097003f3b2468e81f44e0a696bfa1b023a","transactionPosition":1},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x50e398f","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d5792df12b31eb69e7f1"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0982f5e6e633300b9ec43c3c4886e2097003f3b2468e81f44e0a696bfa1b023a","transactionPosition":1},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4aa5e73","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000068155a43676e0000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d5792df12b31eb69e7f100000000000000000000000000000000000000000001d5c42b2954b80b2462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x280011","output":"0x000000000000000000000000000000000000000000000006804bcd8948d9a46a"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0982f5e6e633300b9ec43c3c4886e2097003f3b2468e81f44e0a696bfa1b023a","transactionPosition":1},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x3a2a773","value":"0x0","input":"0x40c10f19000000000000000000000000949057ee441110ff12ab10136a4db45aa4e66daa000000000000000000000000000000000000000000000006804bcd8948d9a46a"},"result":{"gasUsed":"0x28e0c9a","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0982f5e6e633300b9ec43c3c4886e2097003f3b2468e81f44e0a696bfa1b023a","transactionPosition":1},{"type":"call","subtraces":1,"traceAddress":[],"action":{"callType":"call","from":"0xd9a8a0fb784e689da100e6ced30444a65026a6fa","to":"0x2c12644dcc2582f19809d866baa347beab096c4c","gas":"0x63794e7","value":"0x0","input":"0x9940686e00000000000000000000000000000000000000000000003689816c8fb62b4000"},"result":{"gasUsed":"0x32a64c2","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x42e86155494bf1511910887ff8eafa726e2bffc0d09e8e9d7668a179db46f3f4","transactionPosition":2},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"call","from":"0x2c12644dcc2582f19809d866baa347beab096c4c","to":"0xdfd407cad0652387ee1138196b3a3dc2e72523f0","gas":"0x5bae7af","value":"0x0","input":"0xf3fef3a3000000000000000000000000d9a8a0fb784e689da100e6ced30444a65026a6fa00000000000000000000000000000000000000000000003689816c8fb62b4000"},"result":{"gasUsed":"0x1cb3a01","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x42e86155494bf1511910887ff8eafa726e2bffc0d09e8e9d7668a179db46f3f4","transactionPosition":2},{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0x0925fc3155a79e3436520d39dc96e2c981793948","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x56d71e3","value":"0x62e115c008a880000","input":"0xb6b55f250000000000000000000000000000000000000000000000062cf5246d0c800000"},"result":{"gasUsed":"0x1702523","output":"0x0000000000000000000000000000000000000000000000062d14d00f38685c32"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x4f401a0","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d57fae3cf8bb34438c5b"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x490266d","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000062e115c008a88000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d57fae3cf8bb34438c5b00000000000000000000000000000000000000000001d5caac7ef8ee820462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x28000d","output":"0x0000000000000000000000000000000000000000000000062d14d00f38685c32"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x3886f70","value":"0x0","input":"0x40c10f190000000000000000000000000925fc3155a79e3436520d39dc96e2c9817939480000000000000000000000000000000000000000000000062d14d00f38685c32"},"result":{"gasUsed":"0x278bf75","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0x820950a6d3e0bf003cd3896f7a4072db20ecf079","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x5907358","value":"0xa4cc799563c380000","input":"0xb6b55f2500000000000000000000000000000000000000000000000a4b1d45f8ff2c0000"},"result":{"gasUsed":"0x1702523","output":"0x00000000000000000000000000000000000000000000000a4b22b0195e034453"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x516770f","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d585db51c8ca6cabe88d"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4b29bdc","value":"0x0","input":"0x7da65e7900000000000000000000000000000000000000000000000a4cc799563c38000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d585db51c8ca6cabe88d00000000000000000000000000000000000000000001d5d0da9054ef0c8c62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2802c9","output":"0x00000000000000000000000000000000000000000000000a4b22b0195e034453"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x3aae22e","value":"0x0","input":"0x40c10f19000000000000000000000000820950a6d3e0bf003cd3896f7a4072db20ecf07900000000000000000000000000000000000000000000000a4b22b0195e034453"},"result":{"gasUsed":"0x294bcb7","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4},{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0xd4b43aaeea5af6febd0d1fbe4ae3265fcaa99d5e","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x57f42a2","value":"0x5dacd13ca9e300000","input":"0xb6b55f25000000000000000000000000000000000000000000000005d9d463298fe90000"},"result":{"gasUsed":"0x170250b","output":"0x000000000000000000000000000000000000000000000005d9ddd29527f713f9"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0eb03688007d1fb1516363500a528b67b07dc5376f9677963e71b38d43447c07","transactionPosition":5},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x5058b1c","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d590267478e3caaf2ce0"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0eb03688007d1fb1516363500a528b67b07dc5376f9677963e71b38d43447c07","transactionPosition":5},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4a1b000","value":"0x0","input":"0x7da65e79000000000000000000000000000000000000000000000005dacd13ca9e30000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d590267478e3caaf2ce000000000000000000000000000000000000000000001d5db2757ee4548c462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2805a5","output":"0x000000000000000000000000000000000000000000000005d9ddd29527f713f9"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0eb03688007d1fb1516363500a528b67b07dc5376f9677963e71b38d43447c07","transactionPosition":5},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x399f382","value":"0x0","input":"0x40c10f19000000000000000000000000d4b43aaeea5af6febd0d1fbe4ae3265fcaa99d5e000000000000000000000000000000000000000000000005d9ddd29527f713f9"},"result":{"gasUsed":"0x286f917","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0eb03688007d1fb1516363500a528b67b07dc5376f9677963e71b38d43447c07","transactionPosition":5},{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0x92eea78787077bfa466571b0641e1e3a3a175353","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x5671933","value":"0x58788cb94b1d80000","input":"0xb6b55f2500000000000000000000000000000000000000000000000586901af3a3910000"},"result":{"gasUsed":"0x170250b","output":"0x00000000000000000000000000000000000000000000000586a6d51b1785cbc1"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb14ff53c853868b557a703a3b9d004fc56c9797db2e6410b8945562d5d74d2d","transactionPosition":6},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x4edc253","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d59600524b78f2a640d9"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb14ff53c853868b557a703a3b9d004fc56c9797db2e6410b8945562d5d74d2d","transactionPosition":6},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x489e737","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000058788cb94b1d8000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d59600524b78f2a640d900000000000000000000000000000000000000000001d5e10225020fe6f462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x27fe41","output":"0x00000000000000000000000000000000000000000000000586a6d51b1785cbc1"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb14ff53c853868b557a703a3b9d004fc56c9797db2e6410b8945562d5d74d2d","transactionPosition":6},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x38231ff","value":"0x0","input":"0x40c10f1900000000000000000000000092eea78787077bfa466571b0641e1e3a3a17535300000000000000000000000000000000000000000000000586a6d51b1785cbc1"},"result":{"gasUsed":"0x273a6a1","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb14ff53c853868b557a703a3b9d004fc56c9797db2e6410b8945562d5d74d2d","transactionPosition":6},{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0x64a970b83638f86e701bf08fce056e4b81be41fc","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x56ea9e5","value":"0x5f68e8131ecf80000","input":"0xb6b55f25000000000000000000000000000000000000000000000005f595d090deb10000"},"result":{"gasUsed":"0x1702523","output":"0x000000000000000000000000000000000000000000000005f59ad1bdd81cd6b7"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x7c328a3567d3b2acb741fe44005f08128962c7191792e38826372d9bfd9b3a52","transactionPosition":7},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x4f534c2","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d59b86f920940a2c0c9a"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x7c328a3567d3b2acb741fe44005f08128962c7191792e38826372d9bfd9b3a52","transactionPosition":7},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x491598f","value":"0x0","input":"0x7da65e79000000000000000000000000000000000000000000000005f68e8131ecf8000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d59b86f920940a2c0c9a00000000000000000000000000000000000000000001d5e689adcda498cc62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2805a1","output":"0x000000000000000000000000000000000000000000000005f59ad1bdd81cd6b7"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x7c328a3567d3b2acb741fe44005f08128962c7191792e38826372d9bfd9b3a52","transactionPosition":7},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x3899d14","value":"0x0","input":"0x40c10f1900000000000000000000000064a970b83638f86e701bf08fce056e4b81be41fc000000000000000000000000000000000000000000000005f59ad1bdd81cd6b7"},"result":{"gasUsed":"0x279afd0","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x7c328a3567d3b2acb741fe44005f08128962c7191792e38826372d9bfd9b3a52","transactionPosition":7},{"type":"call","subtraces":3,"traceAddress":[],"action":{"callType":"call","from":"0xcb4a20894abbf465636097456a2bd0657ee0d693","to":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","gas":"0x569bff1","value":"0xde0b6b3a7640000","input":"0xb6b55f250000000000000000000000000000000000000000000000000dbd2fc137a30000"},"result":{"gasUsed":"0x17023f2","output":"0x0000000000000000000000000000000000000000000000000dde7f945812e15e"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb30193073b4479cdad34afc24419fe739000ee82ad9ef07d257392588f0d76a","transactionPosition":8},{"type":"call","subtraces":0,"traceAddress":[0],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x4f0600f","value":"0x0","input":"0x18160ddd"},"result":{"gasUsed":"0x432ae0","output":"0x00000000000000000000000000000000000000000001d5a17c93f251e248e351"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb30193073b4479cdad34afc24419fe739000ee82ad9ef07d257392588f0d76a","transactionPosition":8},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x48c84dc","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d5a17c93f251e248e35100000000000000000000000000000000000000000001d5ec803c4ed685c462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x27f9a9","output":"0x0000000000000000000000000000000000000000000000000dde7f945812e15e"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb30193073b4479cdad34afc24419fe739000ee82ad9ef07d257392588f0d76a","transactionPosition":8},{"type":"call","subtraces":0,"traceAddress":[2],"action":{"callType":"call","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x493cd7e48854582eb9aa3a303c06984d23f5a30e","gas":"0x384d3bc","value":"0x0","input":"0x40c10f19000000000000000000000000cb4a20894abbf465636097456a2bd0657ee0d6930000000000000000000000000000000000000000000000000dde7f945812e15e"},"result":{"gasUsed":"0x275cf7f","output":"0x"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb30193073b4479cdad34afc24419fe739000ee82ad9ef07d257392588f0d76a","transactionPosition":8}]}
mikers@mikers-B560-DS3H-AC-Y1:~/dev/filecoin-project/lotus$ curl -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "Filecoin.EthTraceFilter",
    "params": [{
      "fromBlock": "0x1A34D6",
      "toBlock": "0x1A34D7",
      "fromAddress": ["0x51e1f72b655528de2d4d88e70bd53774db8d0b0c"],
      "toAddress": ["0x9b038febc0b3c501fdad8b0adc4386cc21aadff4"]
    }],
    "id": 1
  }' \
  http://127.0.0.1:1234/rpc/v1
{"id":1,"jsonrpc":"2.0","result":[{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4aa5e73","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000068155a43676e0000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d5792df12b31eb69e7f100000000000000000000000000000000000000000001d5c42b2954b80b2462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x280011","output":"0x000000000000000000000000000000000000000000000006804bcd8948d9a46a"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0982f5e6e633300b9ec43c3c4886e2097003f3b2468e81f44e0a696bfa1b023a","transactionPosition":1},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x490266d","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000062e115c008a88000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d57fae3cf8bb34438c5b00000000000000000000000000000000000000000001d5caac7ef8ee820462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x28000d","output":"0x0000000000000000000000000000000000000000000000062d14d00f38685c32"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4b29bdc","value":"0x0","input":"0x7da65e7900000000000000000000000000000000000000000000000a4cc799563c38000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d585db51c8ca6cabe88d00000000000000000000000000000000000000000001d5d0da9054ef0c8c62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2802c9","output":"0x00000000000000000000000000000000000000000000000a4b22b0195e034453"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4a1b000","value":"0x0","input":"0x7da65e79000000000000000000000000000000000000000000000005dacd13ca9e30000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d590267478e3caaf2ce000000000000000000000000000000000000000000001d5db2757ee4548c462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2805a5","output":"0x000000000000000000000000000000000000000000000005d9ddd29527f713f9"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0eb03688007d1fb1516363500a528b67b07dc5376f9677963e71b38d43447c07","transactionPosition":5},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x489e737","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000058788cb94b1d8000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d59600524b78f2a640d900000000000000000000000000000000000000000001d5e10225020fe6f462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x27fe41","output":"0x00000000000000000000000000000000000000000000000586a6d51b1785cbc1"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb14ff53c853868b557a703a3b9d004fc56c9797db2e6410b8945562d5d74d2d","transactionPosition":6},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x491598f","value":"0x0","input":"0x7da65e79000000000000000000000000000000000000000000000005f68e8131ecf8000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d59b86f920940a2c0c9a00000000000000000000000000000000000000000001d5e689adcda498cc62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2805a1","output":"0x000000000000000000000000000000000000000000000005f59ad1bdd81cd6b7"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x7c328a3567d3b2acb741fe44005f08128962c7191792e38826372d9bfd9b3a52","transactionPosition":7},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x48c84dc","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d5a17c93f251e248e35100000000000000000000000000000000000000000001d5ec803c4ed685c462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x27f9a9","output":"0x0000000000000000000000000000000000000000000000000dde7f945812e15e"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb30193073b4479cdad34afc24419fe739000ee82ad9ef07d257392588f0d76a","transactionPosition":8}]}
mikers@mikers-B560-DS3H-AC-Y1:~/dev/filecoin-project/lotus$ curl -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "Filecoin.EthTraceFilter",
    "params": [{
      "fromBlock": "0x1A34D6",
      "toBlock": "0x1A34D7",
      "after": 1,
      "fromAddress": ["0x51e1f72b655528de2d4d88e70bd53774db8d0b0c"],
      "toAddress": ["0x9b038febc0b3c501fdad8b0adc4386cc21aadff4"]
    }],
    "id": 1
  }' \
  http://127.0.0.1:1234/rpc/v1
{"id":1,"jsonrpc":"2.0","result":[{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x490266d","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000062e115c008a88000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d57fae3cf8bb34438c5b00000000000000000000000000000000000000000001d5caac7ef8ee820462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x28000d","output":"0x0000000000000000000000000000000000000000000000062d14d00f38685c32"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4b29bdc","value":"0x0","input":"0x7da65e7900000000000000000000000000000000000000000000000a4cc799563c38000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d585db51c8ca6cabe88d00000000000000000000000000000000000000000001d5d0da9054ef0c8c62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2802c9","output":"0x00000000000000000000000000000000000000000000000a4b22b0195e034453"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4a1b000","value":"0x0","input":"0x7da65e79000000000000000000000000000000000000000000000005dacd13ca9e30000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d590267478e3caaf2ce000000000000000000000000000000000000000000001d5db2757ee4548c462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2805a5","output":"0x000000000000000000000000000000000000000000000005d9ddd29527f713f9"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0eb03688007d1fb1516363500a528b67b07dc5376f9677963e71b38d43447c07","transactionPosition":5},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x489e737","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000058788cb94b1d8000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d59600524b78f2a640d900000000000000000000000000000000000000000001d5e10225020fe6f462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x27fe41","output":"0x00000000000000000000000000000000000000000000000586a6d51b1785cbc1"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb14ff53c853868b557a703a3b9d004fc56c9797db2e6410b8945562d5d74d2d","transactionPosition":6},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x491598f","value":"0x0","input":"0x7da65e79000000000000000000000000000000000000000000000005f68e8131ecf8000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d59b86f920940a2c0c9a00000000000000000000000000000000000000000001d5e689adcda498cc62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2805a1","output":"0x000000000000000000000000000000000000000000000005f59ad1bdd81cd6b7"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x7c328a3567d3b2acb741fe44005f08128962c7191792e38826372d9bfd9b3a52","transactionPosition":7},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x48c84dc","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d5a17c93f251e248e35100000000000000000000000000000000000000000001d5ec803c4ed685c462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x27f9a9","output":"0x0000000000000000000000000000000000000000000000000dde7f945812e15e"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xeb30193073b4479cdad34afc24419fe739000ee82ad9ef07d257392588f0d76a","transactionPosition":8}]}
mikers@mikers-B560-DS3H-AC-Y1:~/dev/filecoin-project/lotus$ curl -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "Filecoin.EthTraceFilter",
    "params": [{
      "fromBlock": "0x1A34D6",
      "toBlock": "0x1A34D7",
      "count": 2,
      "fromAddress": ["0x51e1f72b655528de2d4d88e70bd53774db8d0b0c"],
      "toAddress": ["0x9b038febc0b3c501fdad8b0adc4386cc21aadff4"]
    }],
    "id": 1
  }' \
  http://127.0.0.1:1234/rpc/v1
{"id":1,"jsonrpc":"2.0","result":[{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4aa5e73","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000068155a43676e0000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d5792df12b31eb69e7f100000000000000000000000000000000000000000001d5c42b2954b80b2462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x280011","output":"0x000000000000000000000000000000000000000000000006804bcd8948d9a46a"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0x0982f5e6e633300b9ec43c3c4886e2097003f3b2468e81f44e0a696bfa1b023a","transactionPosition":1},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x490266d","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000062e115c008a88000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d57fae3cf8bb34438c5b00000000000000000000000000000000000000000001d5caac7ef8ee820462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x28000d","output":"0x0000000000000000000000000000000000000000000000062d14d00f38685c32"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3}]}
mikers@mikers-B560-DS3H-AC-Y1:~/dev/filecoin-project/lotus$ curl -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "Filecoin.EthTraceFilter",
    "params": [{
      "fromBlock": "0x1A34D6",
      "toBlock": "0x1A34D7",
      "after": 1,
      "count": 2,
      "fromAddress": ["0x51e1f72b655528de2d4d88e70bd53774db8d0b0c"],
      "toAddress": ["0x9b038febc0b3c501fdad8b0adc4386cc21aadff4"]
    }],
    "id": 1
  }' \
  http://127.0.0.1:1234/rpc/v1
{"id":1,"jsonrpc":"2.0","result":[{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x490266d","value":"0x0","input":"0x7da65e790000000000000000000000000000000000000000000000062e115c008a88000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d57fae3cf8bb34438c5b00000000000000000000000000000000000000000001d5caac7ef8ee820462150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x28000d","output":"0x0000000000000000000000000000000000000000000000062d14d00f38685c32"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xfda410d99e78e7a721d4b7806e7fccc15dc61d8604d3c1bc04f5de89abc57b26","transactionPosition":3},{"type":"call","subtraces":0,"traceAddress":[1],"action":{"callType":"staticcall","from":"0x51e1f72b655528de2d4d88e70bd53774db8d0b0c","to":"0x9b038febc0b3c501fdad8b0adc4386cc21aadff4","gas":"0x4b29bdc","value":"0x0","input":"0x7da65e7900000000000000000000000000000000000000000000000a4cc799563c38000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000001d585db51c8ca6cabe88d00000000000000000000000000000000000000000001d5d0da9054ef0c8c62150000000000000000000000000000000000000000000078413a602fbefafda213"},"result":{"gasUsed":"0x2802c9","output":"0x00000000000000000000000000000000000000000000000a4b22b0195e034453"},"blockHash":"0x7b8e74a0d9eeb7061d821727d211d7676012116b4c37173e119d559b8402a9eb","blockNumber":1717462,"transactionHash":"0xe8e54c8645944d371c43de77c1f535435a154d93a72c218dde6b6594f6fbc2f4","transactionPosition":4}]}

Copy link

github-actions bot commented Jun 20, 2024

@snissn snissn marked this pull request as ready for review June 25, 2024 00:11
@snissn snissn self-assigned this Jun 25, 2024
node/impl/full/eth.go Outdated Show resolved Hide resolved
Comment on lines +1059 to +1067
fromBlock, err := a.EthBlockNumberFromString(ctx, filter.FromBlock)
if err != nil {
return nil, xerrors.Errorf("cannot parse fromBlock: %w", err)
}

toBlock, err := a.EthBlockNumberFromString(ctx, filter.ToBlock)
if err != nil {
return nil, xerrors.Errorf("cannot parse toBlock: %w", err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these are specified to be optional in the eth docs, can we find out what their default behaviour is if you don't specify them?

Copy link
Contributor Author

@snissn snissn Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not finding too much clarity yet. I have found this reference https://github.com/openethereum/parity-ethereum/blob/55c90d4016505317034e3e98f699af07f5404b63/ethcore/src/client/client.rs#L2052 which leads to a call that implies that from/to block is not null: https://github.com/openethereum/parity-ethereum/blob/55c90d4016505317034e3e98f699af07f5404b63/ethcore/src/client/client.rs#L1249

I think a really reasonable default value for FromBlock / ToBlock being empty is to use a default value of "latest"

implemented here: f74fd60

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my read of https://github.com/ledgerwatch/erigon/blob/4bcfa59f7ebdab9888e13f2fb8344c694a589ea8/turbo/jsonrpc/trace_filtering.go#L315-L326 is that from defaults to 0 and to defaults to head. But 0 seems a little silly to me, so both being latest is probably ok I guess.

results = append(results, &txTrace)

// If Count is specified, limit the results
if filter.Count > 0 && len(results) >= filter.Count {
Copy link
Member

@rvagg rvagg Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're going to need a maximum length for results regardless of Count because this could allow users to fetch unreasonably large results.

You can see an example of this in the Events.MaxFilterResults configuration option and how it gets used in the various components that need it (grep for MaxFilterResults); but the thing we shouldn't copy from that is that it just truncates your results silently:

if f.maxResults > 0 && len(f.collected) == f.maxResults {
copy(f.collected, f.collected[1:])
f.collected = f.collected[:len(f.collected)-1]
}
- I would much rather than API return an error so I know I'm not missing out on information so I can tighten my filter.

It would be great to find out what an ethereum implementation uses for a max, and what they do when they hit max, and try and copy that.

for _, blockTrace := range blockTraces {
if matchFilterCriteria(blockTrace, filter) {
traceCounter++
if traceCounter <= filter.After {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean After is 1-based? so if I say "after 1" then I should expect the 2nd and beyond?

node/impl/full/eth.go Outdated Show resolved Hide resolved
// Trace filter should find the transaction
traces, err := client.EthTraceFilter(ctx, filter)
require.NoError(t, err)
require.NotNil(t, traces)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we assert anything about the trace itself? or is it impenetrable garbage for our purposes here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snissn and others added 2 commits June 27, 2024 13:37
Co-authored-by: Rod Vagg <rod@vagg.org>
@rvagg
Copy link
Member

rvagg commented Jun 28, 2024

@snissn I was just going looking for source of the reference implementation of this but I've noticed this isn't in go-ethereum, only in "openethereum and erigon". So with one of those deprecated we only have erigon. I know little of the eth ecosystem, but in how widespread use is erigon, and how common is this call? Are people begging for this in Filecoin? And do we want to be signing up to be supporting even more methods than go-ethereum does when we have a fraction of the ability to support them?

@rvagg
Copy link
Member

rvagg commented Jun 28, 2024

And btw the behaviour of default values seems to mostly be in here: https://github.com/ledgerwatch/erigon/blob/5ee7f351f5361ac1070b28f1f25455b6d00905af/turbo/jsonrpc/trace_filtering.go#L286-L316

Plus a bunch more behavioural things in filterV3 below it.

From default 0, To default to head (I think). Both inclusive. I'm also not seeing a limit in there, which seems a bit off. Surely this doesn't let you call for 0 to head and it just streams as much as it has? Maybe there's a time limit or byte limit on output somewhere on the RPC layer that limits this.

// Optional, default: nil.
// The JSON decoding must treat a string as equivalent to an array with one value, for example
// "0x8888f1f195afa192cfee86069858" must be decoded as [ "0x8888f1f195afa192cfee86069858" ]
FromAddress *[]string `json:"fromAddress,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two slices don't need to be pointers, I don't think you gain anything from having an additional layer of nil and needing to dereference these. But, there is a EthAddressList type you could use instead of []string here, which does the special single vs array json decoding for you, so you should probably swap them out for that. See EthFilterSpec and EthSubscriptionParams which have the same comment about decoding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node/impl/full/eth.go Outdated Show resolved Hide resolved
Co-authored-by: Rod Vagg <rod@vagg.org>
@snissn snissn marked this pull request as draft July 4, 2024 00:49
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.

None yet

2 participants