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

MemoryBuffer, precompiles, raw_call #885

Merged
merged 1 commit into from May 24, 2023

Conversation

g-r-a-n-t
Copy link
Member

@g-r-a-n-t g-r-a-n-t commented May 11, 2023

added the following to the std lib:

  • memory buffer abstraction
  • support for all precompile calls
  • implemented ctx.raw_call(...)

To-Do

  • OPTIONAL: Update Spec if applicable
  • Add entry to the release notes (may forgo for trivial changes)
  • Clean up commit history

@g-r-a-n-t g-r-a-n-t marked this pull request as draft May 11, 2023 03:35
@Y-Nak Y-Nak marked this pull request as ready for review May 11, 2023 12:29
@g-r-a-n-t g-r-a-n-t marked this pull request as draft May 11, 2023 14:23
crates/tests/fixtures/files/buf.fe Outdated Show resolved Hide resolved
crates/tests/fixtures/files/precompiles.fe Outdated Show resolved Hide resolved
crates/tests/fixtures/files/precompiles.fe Outdated Show resolved Hide resolved
crates/library/std/src/buf.fe Outdated Show resolved Hide resolved
}
}

// todo: fix compiler panic produced by this
Copy link
Member Author

Choose a reason for hiding this comment

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

report

return buf
}

// todo: fix compiler panic produced by this
Copy link
Member Author

Choose a reason for hiding this comment

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

report this if not a duplicate issue

crates/library/std/src/buf.fe Outdated Show resolved Hide resolved
crates/library/std/src/buf.fe Outdated Show resolved Hide resolved
crates/library/std/src/buf.fe Outdated Show resolved Hide resolved

// todo: require no return value
#test
// todo: yulgen panic on `identity`
Copy link
Member Author

Choose a reason for hiding this comment

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

report

@g-r-a-n-t g-r-a-n-t changed the title Precompiles MemoryBuffer, precompiles, raw_call May 17, 2023
@g-r-a-n-t g-r-a-n-t marked this pull request as ready for review May 17, 2023 22:30
@g-r-a-n-t g-r-a-n-t force-pushed the precompiles branch 3 times, most recently from df25226 to a82226a Compare May 22, 2023 16:51
Copy link
Collaborator

@cburgdorf cburgdorf left a comment

Choose a reason for hiding this comment

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

Looks nice. Just make sure to file the issues if you haven't already.

crates/library/std/src/buf.fe Show resolved Hide resolved
crates/library/std/src/buf.fe Show resolved Hide resolved
@@ -0,0 +1,15 @@
pub fn min(_ x: u256, _ y: u256) -> u256 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I just wanted to suggest that we could define an Ord trait and then have the min / max functions be generic and work with any T that is Ord but free floating functions such as these can not use generics yet as we only allow struct methods to be generic for now....so, nothing to see here.

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

3 participants