hubble-contracts icon indicating copy to clipboard operation
hubble-contracts copied to clipboard

Tricks to pry data out of internal transaction

Open ChihChengLiang opened this issue 4 years ago • 1 comments

What's wrong

We currently have some data that are too gas costly to log, we rather want to parse them from the calldata.

But if the function is called from other contracts, we can't parse the calldata.

How can we fix it

  1. use node that supports debug_traceTransaction
  2. use mainnet fork

Quoting Igor

  1. replace all logs to empty and do some tricks for reconstructing the data (add special functions with logging enabled)
  2. load block
  3. fork mainnet in current point with local evm (like ganache)
  4. execute the block with loggable functions
  5. collect the log

ChihChengLiang avatar Feb 24 '21 05:02 ChihChengLiang

This issue is specific to the public key registry contract.

  • The public keys are expensive to log in the event.
  • The coordinator now parse calldata to sync the public key
  • People can register public keys through other proxy contracts. If this happens then the coordinator is not able to sync the public key with the current way
  • Technically it is possible to get the public key from the internal transaction.

ChihChengLiang avatar May 04 '21 15:05 ChihChengLiang