-
Notifications
You must be signed in to change notification settings - Fork 4
feat(spl): cheatcodes that model spl's account domain data #806
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
base: feature/p-token
Are you sure you want to change the base?
Conversation
deeb8e9 to
11d13ed
Compare
ef07858 to
8961eba
Compare
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 am struggling a bit to follow the code in the module. What are the typical calls in the SPL source code to access the data inside the RefCell ? Maybe you could add some extra information between the code section?
The info.md does not really provide that information, and it is required to understand why we are capturing these function calls.
| SPLRefCell( | ||
| place( | ||
| LOCAL, | ||
| appendP(PROJS, projectionElemDeref projectionElemField(fieldIdx(1), #hack()) .ProjectionElems) | ||
| ), | ||
| Integer(?SplLamports:Int, 64, false) | ||
| ) |
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.
What is the first parameter of SPLRefCell modeling?
This value here looks like a self-reference: #setLocalValue above writes to place(LOCAL, PROJS + Deref) the value which contains a place(LOCAL, PROJS + Deref + Field(1)).
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.
Yes, this is used to reference itself for pack to write back.
| <k> #execTerminator(terminator(terminatorKindCall(FUNC, OP:Operand OPS:Operands, DEST, TARGET, UNWIND), _SPAN)) | ||
| => #finishSPLRcDeref(OP, DEST, TARGET, FUNC, OP OPS, UNWIND) |
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.
Do we expect OPS to be present if the function is ...::deref ? Probably deref will only ever have one argument, or not?
| rule [spl-vec-as-slice-copy]: | ||
| <k> #execTerminator(terminator(terminatorKindCall(FUNC, OP:Operand _OPS:Operands, DEST, someBasicBlockIdx(TARGET), _UNWIND), _SPAN)) | ||
| => #setLocalValue(DEST, OP) ~> #execBlockIdx(TARGET) |
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.
Similar situation here, _OPS is unused and should always just be .Operands if the function is _.as_slice()
cfb0e22 to
6e44c4b
Compare
No description provided.