hubble-contracts
hubble-contracts copied to clipboard
Tricks to pry data out of internal transaction
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
- use node that supports
debug_traceTransaction - use mainnet fork
Quoting Igor
- replace all logs to empty and do some tricks for reconstructing the data (add special functions with logging enabled)
- load block
- fork mainnet in current point with local evm (like ganache)
- execute the block with loggable functions
- collect the log
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.