Consensys / linea-tracer

Part of the Linea stack responsible for extracting data from the execution of an EVM client in order to construct large matrices called execution traces.
https://linea.build
Other
24 stars 20 forks source link

Does the get of the WorldUpdater class handle keys that aren't in the state gracefully ? #871

Open OlivierBBB opened 1 month ago

OlivierBBB commented 1 month ago

There is no getOrDefault or so method when querying the world state to extract an account using an address. What will happen when we do a CALL to a non existent account e.g. à la

if (isPrecompile(calleeAddress)) {
  this.scenarioFragment.setScenario(CALL_PRC_UNDEFINED);
} else {
  this.scenarioFragment.setScenario(
      world.get(calleeAddress).hasCode()
          ? CALL_SMC_UNDEFINED
          : CALL_EOA_SUCCESS_WONT_REVERT);

  // TODO is world == worldUpdater & what happen if get
  //  doesn't work ?
  // TODO: write a test where the recipient of the call does not exist in the state
}

Take from CallSection.java.

lu-pinto commented 1 month ago

I'm not if this question is for me or not but on the EVM side you have the option to use getOrCreate so if it doesn't exist it will create an account: MessageCallProcessor.java#L109-L110