Skip to content
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(EOF): change oob behavior of RETURNDATALOAD and RETURNDATACOPY #1476

Merged
merged 15 commits into from
Jun 8, 2024

Conversation

jpgonzalezra
Copy link
Contributor

ISSUE:

Change is here: ipsilon/eof#90

RETURNDATACOPY:
- same behavior as legacy, but changes the exceptional halt behavior to zero-padding behavior

RETURNDATALOAD:
- if offset + 32 > len(returndata buffer) the result is zero-padded (same behavior as CALLDATALOAD). see matching behavior of RETURNDATACOPY in Modified Behavior section.

@jpgonzalezra jpgonzalezra changed the title chore: change oob behavior of RETURNDATALOAD and RETURNDATACOPY feat(EOF): change oob behavior of RETURNDATALOAD and RETURNDATACOPY May 31, 2024
@jpgonzalezra jpgonzalezra marked this pull request as draft June 2, 2024 19:58
@rakita
Copy link
Member

rakita commented Jun 3, 2024

Old behaviour of RETURNDATACOPY needs to be preserved if it is not EOF bytecode

@jpgonzalezra
Copy link
Contributor Author

Thanks, @rakita! I'll start running the ethtests locally so I can detect these cases more easily.

@jpgonzalezra jpgonzalezra marked this pull request as ready for review June 3, 2024 23:46
@jpgonzalezra
Copy link
Contributor Author

@rakita I thought it would be easier to make it backwards compatible haha. Let me know what you think

@rakita
Copy link
Member

rakita commented Jun 8, 2024

Hey, will take this over so it can be merged

.shared_memory
.slice_mut(memory_offset + copy_len, len - copy_len)
.fill(0);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else if {error} is missing. Will restructure code a little bit here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, go ahead 💪

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, waiting for CI.

@jpgonzalezra can you take a look. in returndatacopy I used shared_memory.set_data and in returndataload i removed few lines.

@jpgonzalezra
Copy link
Contributor Author

@rakita awesome, the code is very clear now, thank you 💪

@rakita rakita merged commit 8103cc1 into bluealloy:main Jun 8, 2024
25 checks passed
@github-actions github-actions bot mentioned this pull request Jun 8, 2024
This was referenced Jun 11, 2024
This was referenced Jun 17, 2024
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.

None yet

2 participants