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

Enhance Ethereum compatibility while deploying contracts #2802

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ public enum ConsensusRule {
RSKIP417("rskip417"),
RSKIP428("rskip428"),
RSKIP434("rskip434"),
RSKIP438("rskip438")
RSKIP438("rskip438"),
RSKIP453("rskip453")

;

private String configKey;
Expand Down
12 changes: 12 additions & 0 deletions rskj-core/src/main/java/org/ethereum/vm/program/Program.java
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,24 @@ private ProgramResult getProgramResult(RskAddress senderAddress, byte[] nonce, D
this,
"No gas to return just created contract",
storageCost));

if (activations.isActive(ConsensusRule.RSKIP453)) {
track.rollback();
stackPushZero();
return programResult;
}
} else if (codeLength > Constants.getMaxContractSize()) {
programResult.setException(
ExceptionHelper.tooLargeContractSize(
this,
Constants.getMaxContractSize(),
codeLength));

if (activations.isActive(ConsensusRule.RSKIP453)) {
track.rollback();
stackPushZero();
return programResult;
}
} else {
programResult.spendGas(storageCost);
track.saveCode(contractAddress, code);
Expand Down
1 change: 1 addition & 0 deletions rskj-core/src/main/resources/expected.conf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ blockchain = {
rskip428 = <hardforkName>
rskip434 = <hardforkName>
rskip438 = <hardforkName>
rskip453 = <hardforkName>
}
}
gc = {
Expand Down
1 change: 1 addition & 0 deletions rskj-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ blockchain = {
rskip428 = lovell700
rskip434 = arrowhead631
rskip438 = lovell700
rskip453 = lovell700
}
}
gc = {
Expand Down
Loading