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
35 stars 26 forks source link

wrong calculation for numberMmioInstructions #1517

Closed FlorianHuc closed 1 week ago

FlorianHuc commented 1 week ago

numberMmioInstructions is computed as:

public int numberMmioInstructions() { return totalLeftZeroesInitials + totalNonTrivialInitials + totalRightZeroesInitials; }

but it happens it can be bigger. This seems to happen when going through MLoad L89: public MmuData setMicroInstructions(MmuData mmuData) {

where we set two microinstructions while we have totalNonTrivialInitials 1 only:

Issue is in:

  case MMU_INST_BLAKE -> {
    mmuData = blake.preProcess(mmuData);
    yield blake.setMicroInstructions(mmuData);
  }

blake.preProcess code set this to one but then we enter, setMicroInstructions we add two of them

letypequividelespoubelles commented 1 week ago

which test is breaking ?

edit: I fix the typo and added some more test for BLAKE precompile call, will debug it. It's true we didn't have unit test for BLAKE :(