Skip to content

dimka90/byterun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Decisions

  1. Stack Implementation: Used Python list with validation for 256-bit values and 1024-item limit
  2. Memory Model: Bytearray with automatic expansion and gas calculation
  3. Storage Model: Dictionary-based persistent storage
  4. Gas Metering: Tracked per-operation with dynamic costs for storage
  5. Type Safety: Pydantic models for all data structures

📚 Documentation


🎓 Learning Journey

This project was built to deeply understand Ethereum's execution layer:

  1. Started with: Basic bytecode interpreter concept
  2. Learned: EVM specifications, opcodes, gas mechanics
  3. Implemented: Full EVM with 50+ opcodes
  4. Tested: 100+ tests covering edge cases and properties
  5. Documented: Complete architecture and design decisions

Key Learnings

  • 256-bit arithmetic: Overflow/underflow handling
  • Memory expansion: Dynamic gas costs
  • Storage patterns: SLOAD/SSTORE gas mechanics
  • Stack manipulation: DUP/SWAP operations
  • Testing strategies: Property-based and fuzz testing

🛠️ Development

Setup Development Environment

make setup

Run Tests

make test

Build Docker Image

make build

Run in Docker

make run

🔮 Future Enhancements

  • Precompiled contracts
  • CALL family opcodes
  • CREATE/CREATE2
  • Real-world bytecode execution
  • EVM trace visualization
  • Comparison with geth/execution-specs

📖 References


🤝 Contributing

This is an educational project, but feedback and suggestions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for any new functionality
  4. Ensure all tests pass
  5. Submit a pull request

📄 License

MIT License - see LICENSE for details


👤 Author

FILIBUS YILRIT DIMKA

Built as preparation for Ethereum Foundation internship application.


🙏 Acknowledgments

  • Ethereum Foundation for protocol specifications
  • evm.codes for excellent opcode reference
  • Python community for amazing testing tools

If this project helped you understand the EVM, please ⭐ star it!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published