-
Notifications
You must be signed in to change notification settings - Fork 21
feat: update to go corset version v1127 #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update to go corset version v1127 #825
Conversation
This puts through two fixes needed for go-corset v1.2.0. This is a preparatory step to simplify integration later on.
In several places, there were duplicate constraint handles. These have now been modified to better reflect their differences.
| (defconst (BLOB_BASE_FEE_ENABLE :binary :extern) 1) | ||
|
|
||
| (defconstraint blobbasefee-value | ||
| (defconstraint blobbasefee-value2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to decide which of the two constraints we actually want (i.e. this one or the very similar one in common.lisp)
The bit_shr and bit_sar utility functions were not able to compile on the KOALABEAR_16 fields due a known existing issue with the zkasm register splitting algorithm. Previously, a workaround was used which worked only for the BLS12_377 field. However, a workaround has now been developed which works for both BLS12_377 and KOALABEAR_16.
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
|
||
| (defun (normalized-SIZE_LIMB) | ||
| (defun ((normalized-SIZE_LIMB :i5 :force)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| ;; compute minimum of two values of different widths | ||
| fn min256_64(gas u256, L_gas_diff u64) -> (res u64) { | ||
| var tmp1 u257 | ||
| var tmp1 u256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why it was a u257 ?
| sign, msw, lsw = word | ||
| nword = (sign*0x1ffffffffffffffffffffffffffffffff*2^127)+msw | ||
| res = bit_sar256_u7(nword,m) | ||
| res = bit_sar256_u7((sign*0x1ffffffffffffffffffffffffffffffff*2^127)+msw, m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it just does the same, but without an explicit column with intermediate result right ? Can we do this thanks to a corset new feature ?
| ;; | ||
| sign, hi, lo, b = word | ||
| ;; | ||
| res = (sign*0b11*2^254) + (hi * 2^7) + lo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change here ?
| (defconst (BLOB_BASE_FEE_ENABLE :binary :extern) 1) | ||
|
|
||
| (defconstraint blobbasefee-value | ||
| (defconstraint blobbasefee-value2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name blobasefee-prod and blobbasefee-referencetests instead
There was a duplicate of this constraint which was not conditional on the `BLOB_BASE_FEE_ENABLE` constant. As such, it should have been removed before.
letypequividelespoubelles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
NOTE: resolution required on which version of
blobbasefee-valueshould be kept.Note
Bumps go-corset to v1.1.27, consolidates blobbasefee constraints, renames/clarifies multiple BLS/RLP constraints, tweaks logdata range-check signature, renames an MXP lookup, fixes a width in STP, and refactors bit_sar/bit_shr implementations.
go-corsettov1.1.27in.github/workflows/check.yml.blobbasefee-valuefromcancun/.../common.lisp; keep explicit value constraint in.../linea.lisp.blobbasefee-boundand minor formatting cleanup.stamp-constancy-address-sum,vanishing-values-ct,vanishing-values-index,index-constancy-index-max,counter-constancy-first-and-second,index-constancy-phase.normalized-SIZE_LIMBsignature to(:i5 :force).hub-into-instdecoder->mxp-into-instdecoder.rlptxn: rename transaction constancy totransaction-constancies-requires-evm.rlputils: rename property toct-max-is-ct-constant; fixbytes32constraints naming (byte32--...) and minor formatting.min256_64:tmp1 u257->u256.bit_sar256*andbit_shr256*: remove redundant temps, inline constructions, and adjust workaround decompositions.Written by Cursor Bugbot for commit cdb1fb1. This will update automatically on new commits. Configure here.