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

Refactor near_vm_logic to remove pure methods from ::External. #3019

Closed
evgenykuzyakov opened this issue Jul 21, 2020 · 0 comments · Fixed by #3030
Closed

Refactor near_vm_logic to remove pure methods from ::External. #3019

evgenykuzyakov opened this issue Jul 21, 2020 · 0 comments · Fixed by #3030
Assignees
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-housekeeping Category: Refactoring, cleanups, code quality

Comments

@evgenykuzyakov
Copy link
Collaborator

There are 3 methods in the External trait that don't belong there:

  • sha256
  • keccak256
  • keccak512

They should be implemented directly in near_vm_logic instead of being part of ::External, since the compute of them don't require any external knowledge.

@evgenykuzyakov evgenykuzyakov self-assigned this Jul 21, 2020
@evgenykuzyakov evgenykuzyakov added A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-housekeeping Category: Refactoring, cleanups, code quality labels Jul 21, 2020
nearprotocol-bulldozer bot pushed a commit that referenced this issue Jul 27, 2020
External crate should only contain methods that requires something external to complete. E.g. when interacting with the blockchain.
Pure functions such as sha256 and keccak hashes can go directly to vm-logic.
Bumping versions to `1.1.0`
Fixes: #3019 

# Test plan:
- CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant