a16z / jolt

The simplest and most extensible zkVM. Fast and fully open source from a16z crypto and friends. ⚡
https://jolt.a16zcrypto.com
MIT License
680 stars 146 forks source link

Better errors for insufficient stack or memory size #395

Closed moodlezoup closed 1 week ago

moodlezoup commented 5 months ago

https://jolt.a16zcrypto.com/usage/troubleshooting.html#insufficient-memory-or-stack-size

Currently, the tracer will error out with nondescript errors like Unknown memory mapping 7FFFFE04.

The tracer should detect when we have exhausted the stack and/or heap, and throw a descriptive error if so

ameya-deshmukh commented 4 months ago

Hey! Can I take this up?

moodlezoup commented 4 months ago

Yeah go for it!

moodlezoup commented 3 months ago

@ameya-deshmukh Any update here?

ameya-deshmukh commented 3 months ago

Hey @moodlezoup! Sorry, couldn't find time to work on this. Can I grind this out over the weekend and give you an update by early Monday ET?

moodlezoup commented 3 months ago

Yeah that'd be great! Lmk if you need any pointers

4rgon4ut commented 2 months ago

@ameya-deshmukh @moodlezoup I would like to have a try if you fine with that

ameya-deshmukh commented 2 months ago

Hey @4rgon4ut sure! I didn't get the time to work on this issue, all yours to take

4rgon4ut commented 2 months ago

@moodlezoup I have two questions:

  1. Would you like it to be panics with specified messages (based on the case) or new trap type here
  2. Does tracer/src/emulator/cpu.rs is the right place to add related tests?
moodlezoup commented 2 months ago

@moodlezoup I have two questions:

  1. Would you like it to be panics with specified messages (based on the case) or new trap type here
  2. Does tracer/src/emulator/cpu.rs is the right place to add related tests?

Thanks for taking this!

  1. just a better panic message is fine
  2. I think perhaps tracer/src/emulator/mmu.rs may be a better place for tests
4rgon4ut commented 2 months ago

@moodlezoup does stack grows downwards, from higher stack addr down to the DRAM_BASE ? ref

/// DRAM base address. Offset from this base address
/// is the address in main memory.
pub const DRAM_BASE: u64 = 0x80000000;
moodlezoup commented 2 months ago

@moodlezoup does stack grows downwards, from higher stack addr down to the DRAM_BASE ? ref

/// DRAM base address. Offset from this base address
/// is the address in main memory.
pub const DRAM_BASE: u64 = 0x80000000;

Yes, I believe so