feat: add p/demo/evm (ethereum vm)
Description
A pure package capable of interpreting and executing EVM byte codes, it follows the @moul idea in https://github.com/gnolang/hackerspace/issues/12 :
Introducing a Gno-based EVM (Ethereum Virtual Machine) that serves as an intriguing proof of concept rather than a production-ready solution. It initially focuses on providing comprehensive logic support while future enhancements aim to bridge "syscalls." This capability allows for writing Solidity contracts that can be interpreted by Gno, unlocking new possibilities for bytecode execution. It's worth mentioning that this project holds the potential to offer a novel approach for verifying successful contract porting and exploring other potential use cases.
This implementation aims to follow the EVM spec closely, enabling accurate interpretation of smart contract bytecode in a Gno-native environment. It opens the door to cross-chain compatibility experiments.
See also: gnolang/gno#885 (p/demo/bf).
References
https://ethervm.io/ – Opcode explorer and visualizer
https://www.evm.codes/ – Detailed reference for EVM opcodes
🛠 PR Checks Summary
All Automated Checks passed. ✅
Manual Checks (for Reviewers):
- [ ] IGNORE the bot requirements for this PR (force green CI check)
- [ ] The pull request description provides enough details
Read More
🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.
✅ Automated Checks (for Contributors):
🟢 Maintainers must be able to edit this pull request (more info) 🟢 Pending initial approval by a review team member, or review from tech-staff
☑️ Contributor Actions:
- Fix any issues flagged by automated checks.
- Follow the Contributor Checklist to ensure your PR is ready for review.
- Add new tests, or document why they are unnecessary.
- Provide clear examples/screenshots, if necessary.
- Update documentation, if required.
- Ensure no breaking changes, or include
BREAKING CHANGEnotes. - Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
- Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)
If
🟢 Condition met └── 🟢 And ├── 🟢 The base branch matches this pattern: ^master$ └── 🟢 The pull request was created from a fork (head branch repo: Tchips46/gno)Then
🟢 Requirement satisfied └── 🟢 Maintainer can modify this pull requestPending initial approval by a review team member, or review from tech-staff
If
🟢 Condition met └── 🟢 And ├── 🟢 The base branch matches this pattern: ^master$ └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)Then
🟢 Requirement satisfied └── 🟢 If ├── 🟢 Condition │ └── 🟢 Or │ ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 leohhhn n0izn0iz notJoon omarsy x1unix] (with state "APPROVED") │ ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request │ └── 🟢 This pull request is a draft └── 🟢 Then └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)
If
🟢 Condition met └── 🟢 On every pull requestCan be checked by
- Any user with comment edit permission
The pull request description provides enough details
If
🟢 Condition met └── 🟢 And ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors) └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])Can be checked by
- team core-contributors
Codecov Report
:x: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| tm2/pkg/bft/node/node.go | 0.00% | 1 Missing :warning: |
:loudspeaker: Thoughts on this report? Let us know!
@mvertes about the disassembler: do you want to see byte disassemble into EVM instructions (such as PUSH1, JUMPDEST, MLOAD...) or a disassebler in pseudo-gno ?
feedback:
- don't "spend gas", but count it (starts from 0, and is increased at usage)
- allow specifying an execution limit eventually, if 0, no limit, else, act like the normal "gas"
- allow execution without a tx (query)
- add txlink to help generating a call directly in the contracts
- would be nice to "list" all the existing api calls available
foo(uint256, uint256), maybe not possible with just the bytecode?
Hey @Tchips46,
I'll take a look at this, but it's gonna take me a minute to go over the changes 🙏 Is there anything I should know about before diving in (assumptions you guys went with)?
Hey @zivkovicmilos,
We didn't implemented the pre-compiled contracts involving complex algorithms that are used only by very few persons because of the time. Don't hesitate if you a have any questions and good luck !
The CI is failing currently, and I'm not sure we'll be able to get reviews from @mvertes or @zivkovicmilos currently as they're busy with launch. I'll move this to draft and you can feel free to continue working on this PR and make it review-ready.