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

fix: Cancun SELFDESTRUCT semantics incorrect when beneficiary is contract itself and it isn't deleted #17478

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

fix: Cancun SELFDESTRUCT semantics incorrect when beneficiary is cont…

6f16858
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Draft

fix: Cancun SELFDESTRUCT semantics incorrect when beneficiary is contract itself and it isn't deleted #17478

fix: Cancun SELFDESTRUCT semantics incorrect when beneficiary is cont…
6f16858
Select commit
Loading
Failed to load commit list.
GitHub Actions / Node: Unit Test Results failed Jan 22, 2025 in 0s

2 fail, 62 skipped, 129 071 pass in 1h 3m 45s

  1 740 files    1 740 suites   1h 3m 45s ⏱️
129 135 tests 129 071 ✅ 62 💤  2 ❌
135 974 runs  135 900 ✅ 62 💤 12 ❌

Results for commit 6f16858.

Annotations

Check warning on line 0 in com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest

See this annotation in the file changed.

@github-actions github-actions / Node: Unit Test Results

6 out of 8 runs failed: [1] NO (com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest)

hedera-node/hedera-smart-contract-service-impl/build/test-results/test/TEST-com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest.xml [took 0s]
Raw output
org.mockito.exceptions.misusing.PotentialStubbingProblem: 
Strict stubbing argument mismatch. Please check:
 - this invocation of 'selfDestructOperationGasCost' method:
    gasCalculator.selfDestructOperationGasCost(
    null,
    0x0000000000000000000000000000000000000000000000000000000000000000
);
    -> at com.hedera.node.app.service.contract.impl.exec.operations.CustomSelfDestructOperation.execute(CustomSelfDestructOperation.java:132)
 - has following stubbing(s) with different arguments:
    1. gasCalculator.selfDestructOperationGasCost(
    null,
    0x000000000000000000000000000000000000000000000000000000000000029a
);
      -> at com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest.rejectsSelfDestructInStaticChanges(CustomSelfDestructOperationTest.java:134)
Typically, stubbing argument mismatch indicates user mistake when writing tests.
Mockito fails early so that you can debug potential problem easily.
However, there are legit scenarios when this exception generates false negative signal:
  - stubbing the same method multiple times using 'given().will()' or 'when().then()' API
    Please use 'will().given()' or 'doReturn().when()' API for stubbing.
  - stubbed method is intentionally invoked with different arguments by code under test
    Please use default or 'silent' JUnit Rule (equivalent of Strictness.LENIENT).
For more information see javadoc for PotentialStubbingProblem class.
	at app//com.hedera.node.app.service.contract.impl.exec.operations.CustomSelfDestructOperation.execute(CustomSelfDestructOperation.java:132)
	at app//com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest.rejectsSelfDestructInStaticChanges(CustomSelfDestructOperationTest.java:137)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:580)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at [email protected]/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at [email protected]/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at [email protected]/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
	at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at [email protected]/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at [email protected]/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at [email protected]/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
	at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at [email protected]/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596)

Check warning on line 0 in com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest

See this annotation in the file changed.

@github-actions github-actions / Node: Unit Test Results

6 out of 8 runs failed: [2] YES (com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest)

hedera-node/hedera-smart-contract-service-impl/build/test-results/test/TEST-com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest.xml [took 0s]
Raw output
org.mockito.exceptions.misusing.PotentialStubbingProblem: 
Strict stubbing argument mismatch. Please check:
 - this invocation of 'selfDestructOperationGasCost' method:
    gasCalculator.selfDestructOperationGasCost(
    null,
    0x0000000000000000000000000000000000000000000000000000000000000000
);
    -> at com.hedera.node.app.service.contract.impl.exec.operations.CustomSelfDestructOperation.execute(CustomSelfDestructOperation.java:132)
 - has following stubbing(s) with different arguments:
    1. gasCalculator.selfDestructOperationGasCost(
    null,
    0x000000000000000000000000000000000000000000000000000000000000029a
);
      -> at com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest.rejectsSelfDestructInStaticChanges(CustomSelfDestructOperationTest.java:134)
Typically, stubbing argument mismatch indicates user mistake when writing tests.
Mockito fails early so that you can debug potential problem easily.
However, there are legit scenarios when this exception generates false negative signal:
  - stubbing the same method multiple times using 'given().will()' or 'when().then()' API
    Please use 'will().given()' or 'doReturn().when()' API for stubbing.
  - stubbed method is intentionally invoked with different arguments by code under test
    Please use default or 'silent' JUnit Rule (equivalent of Strictness.LENIENT).
For more information see javadoc for PotentialStubbingProblem class.
	at app//com.hedera.node.app.service.contract.impl.exec.operations.CustomSelfDestructOperation.execute(CustomSelfDestructOperation.java:132)
	at app//com.hedera.node.app.service.contract.impl.test.exec.operations.CustomSelfDestructOperationTest.rejectsSelfDestructInStaticChanges(CustomSelfDestructOperationTest.java:137)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:580)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at [email protected]/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at [email protected]/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at [email protected]/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at [email protected]/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
	at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at [email protected]/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at [email protected]/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at [email protected]/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
	at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at [email protected]/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at [email protected]/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596)