• Inphi's avatar
    cannon: Fix GC emulation of Go programs (#11704) · 7ff5e6ed
    Inphi authored
    * cannon: Fix GC emulation of Go programs
    
    Improves Linux/MIPS32 emulation for Go programs that utilize the garbage
    collector and goroutine scheduling.
    
    This adds support for the following syscalls:
    
    - getpid - used by the go scheduler
    - clock_gettime - used by the go scheduler and for GC assists and to properly emulate
      time related operations such as `time.Sleep`.
    
    Note on GC assists:
    
    The Go GC relies on `clock_gettime` for GC "assists", whereby a mutator can perform a little bit
    of GC without waiting for the scheduler to do so.
    A monotonic clock (runtime.nanotime) is used to compute the current goroutine's compute budget.
    By modeling a MIPS32 CPU that runs at some clock speed (ex: 10 MHz), we can provide a consistent
    emulation of monotonic time needed by the Go runtime.
    All other clock_gettime flags are handled as unimplemented syscalls.
    
    * fix unsupported syscalls test
    
    * fix some review comments
    
    * address review comments
    
    * update snapshots
    
    * fuzz invalid memory proof
    
    * reduce test runtime
    
    * tweak realtime emulation
    
    * reduce test runtime
    
    * set a high timeout for heavy fuzz tests
    
    * simplify fuzz
    
    * fix heavy tests
    7ff5e6ed
Name
Last commit
Last update
..
L1 Loading commit data...
L2 Loading commit data...
Safe Loading commit data...
actors Loading commit data...
cannon Loading commit data...
dispute Loading commit data...
fixtures Loading commit data...
governance Loading commit data...
invariants Loading commit data...
kontrol Loading commit data...
legacy Loading commit data...
libraries Loading commit data...
mocks Loading commit data...
periphery Loading commit data...
safe-tools Loading commit data...
setup Loading commit data...
universal Loading commit data...
vendor Loading commit data...
BenchmarkTest.t.sol Loading commit data...
DeployImplementations.t.sol Loading commit data...
DeployOPChain.t.sol Loading commit data...
DeploySuperchain.t.sol Loading commit data...
ExtendedPause.t.sol Loading commit data...
L2Genesis.t.sol Loading commit data...
Predeploys.t.sol Loading commit data...
Preinstalls.t.sol Loading commit data...
Specs.t.sol Loading commit data...