Skip to content

feat!: Brillig typed memory#5395

Merged
sirasistant merged 26 commits into
masterfrom
arv/brillig_typed_memory
Mar 26, 2024
Merged

feat!: Brillig typed memory#5395
sirasistant merged 26 commits into
masterfrom
arv/brillig_typed_memory

Conversation

@sirasistant

@sirasistant sirasistant commented Mar 22, 2024

Copy link
Copy Markdown
Contributor

Brillig had implicitely typed memory, where the memory typing was supossedly respected by the compiler (brillig_gen) but was never checked in runtime. Instead, in runtime the values were truncated to the appropiate bit size when used. This hid some bugs in typing that the compiler was outputting and that would have made the AVM crash.

Memory typing bugs found and fixed:

  • to_radix vector length type
  • to_radix limb type
  • keccak256 length type (u32 vs u64)
  • directive quotient not casting arguments
  • directive invert jump condition on non boolean

This PR aligns brillig more with the AVM by having typed memory actually checked in runtime, and removing the truncations that arithmetic.rs was doing.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants