Closed OlivierBBB closed 1 month ago
We need two Exceptions objects:
Exceptions
The TracedException will be used in the tracing of the stack-rows. We must have the property that
TracedException
short
TracedException = 0 <=> FullExceptions = 0
TracedException = (1 << k)
k
FullExceptions
1
Also the Gas.java should be using the TracedException to determine the outOfGasException flag.
Gas.java
outOfGasException
Example of what we would like to achieve for the CallSection, for instance:
CallSection
// STATICX cases if (Exceptions.staticFault(exceptions)) { this.commonValues.tracedException == Exceptions.STATIC_FAULT; return; } // ... // MXPX case if (Exceptions.memoryExpansionException(exceptions)) { this.commonValues.tracedException == Exceptions.MEMORY_EXPANSION_EXCEPTION; return; } // ... // OOGX case if (Exceptions.outOfGasException(exceptions)) { this.commonValues.tracedException == Exceptions.OUT_OF_GAS_EXCEPTION; this.oogXCall(hub); return; }
The end goal is to replace exceptions below with tracedExceptions in the tracing of StackFragmet.java
exceptions
tracedExceptions
StackFragmet.java
// Exception flag // this is WRONG .pStackOpcx(Exceptions.invalidCodePrefix(exceptions)) .pStackSux(Exceptions.stackUnderflow(exceptions)) .pStackSox(Exceptions.stackOverflow(exceptions)) .pStackMxpx(Exceptions.memoryExpansionException(exceptions)) .pStackOogx(Exceptions.outOfGasException(exceptions)) .pStackRdcx(Exceptions.returnDataCopyFault(exceptions)) .pStackJumpx(Exceptions.jumpFault(exceptions)) .pStackStaticx(Exceptions.staticFault(exceptions)) .pStackSstorex(Exceptions.outOfSStore(exceptions)) .pStackIcpx(contextExceptions.invalidCodePrefix()) .pStackMaxcsx(contextExceptions.codeSizeOverflow())
duplicate of #922
TracedException could alternatively be an enum, which would be cleaner.
enum
We need two
Exceptions
objects:The
TracedException
will be used in the tracing of the stack-rows. We must have the property thatTracedException
is always pure (i.e. a single power of 2 or zero i.e. it's ashort
with at most one nonzero binary digit)TracedException = 0 <=> FullExceptions = 0
TracedException = (1 << k)
then thek
-th bit ofFullExceptions
is1
Also the
Gas.java
should be using theTracedException
to determine theoutOfGasException
flag.Example of what we would like to achieve for the
CallSection
, for instance:The end goal is to replace
exceptions
below withtracedExceptions
in the tracing ofStackFragmet.java