-
Notifications
You must be signed in to change notification settings - Fork 1.6k
func(vm): optimize selfdestruct restriction #6500
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
func(vm): optimize selfdestruct restriction #6500
Conversation
| byte[][] signatures = extractBytesArray( | ||
| words, words[3].intValueSafe() / WORD_SIZE, rawData); | ||
| if (VMConfig.allowTvmSelfdestructRestriction()) { | ||
| int sigArraySize = words[words[3].intValueSafe() / WORD_SIZE].intValueSafe(); |
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.
This should be a general improvement?
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.
Yep, we enhance processing efficiency by moving the judgment to the front end.
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.
Then the PR title and description better adjust accordingly.
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.
There is no difference; the goal is to optimize the proposal content.
| public void extendAndWrite(int address, int allocSize, byte[] data) { | ||
| extend(address, allocSize); | ||
| write(address, data, data.length, false); | ||
| write(address, data, allocSize, 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.
Not sure whether below is better?
int writeSize = Math.min(allocSize, data.length);
write(address, data, writeSize, true);
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.
Your suggestion does not align with the original intent of this method's design.
No description provided.