Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2829] - add hooks for validation #1671

Merged
merged 9 commits into from
Jul 11, 2019

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Jul 11, 2019

PR description

EIP-1602 specifies a new validation step. Add hooks for those to occur.
Move contract size checking into the validation hooks.

shemnon added 6 commits June 26, 2019 11:10
Initial versioning code.  Main hook is that setCode() in MutableAccount now
requires a version (currently a long for performance reasons).

Reference tests all pass (hence the WorldStateMock if block) and
GenesisStateTest has an explicit version test now.
# Conflicts:
#	ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetProtocolSpecs.java
In the future if the versions become sparse or large we will create a "proxy"
version index by putting the standardized indexes into an enum and using
the enum ordinal instead.
EIP-1602 specifies a new validation step.  Add hooks for those to occur.
Move contract size checking into the validation hooks.
Copy link
Contributor

@AbdelStark AbdelStark left a comment

Choose a reason for hiding this comment

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

Looks good to me.


import tech.pegasys.pantheon.ethereum.vm.MessageFrame;

public interface ContractValidationRule {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Discussion) What about using a FunctionalInterface ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may gain more methods in the future, but we can walk it back if that becomes the case.

shemnon added 3 commits July 11, 2019 08:48
…validate

# Conflicts:
#	ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetContractCreationProcessor.java
#	ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/mainnet/MainnetProtocolSpecs.java
#	ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/operations/ExtCodeHashOperationTest.java
@shemnon shemnon merged commit 105304a into PegaSysEng:master Jul 11, 2019
@shemnon shemnon deleted the EIP1702-validate branch July 11, 2019 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants