hashgraph / hedera-smart-contracts

Contains Hedera Smart Contract Service supporting files
Apache License 2.0
37 stars 51 forks source link

Deleted smart contract can be called successfully #667

Closed pathornteng closed 2 months ago

pathornteng commented 5 months ago

Description

A Discord member reported that he can called a deleted smart contract successfully. I can also reproduce the problem. Is this an expected behavior?

This is the transaction that deleted the contract https://hashscan.io/testnet/transaction/1707474184.595911029

This is the transaction that call a smart contract function https://hashscan.io/testnet/transaction/1707474281.929755003

Note: the transaction will only succeed if I call a function to change state. Querying a smart contract returns CONTRACT_DELETED as expected.

Steps to reproduce

  1. Create a smart contract
  2. Delete the smart contract
  3. Call the smart contract function

Additional context

No response

Hedera network

testnet

Version

latest

Operating system

None

ebadiere commented 5 months ago

@pathornteng Can you please attach the smart contract code you used to reproduce this issue? I can reproduce this partially, in that I am seeing what maybe an issue with selfdestruct, but I see in hashscan and the mirror node that your contract is in a deleted state and mine is not. More information will be helpful here.

ebadiere commented 4 months ago

I was able to reproduce it. I opened an issue for it on services.

david-bakin-sl commented 2 months ago

Related issue in services https://github.com/hashgraph/hedera-services/issues/11664 is closed with a fix that went in to 0.49. Consider whether this issue is now closed? Also, remember that with Cancun changes - in 0.50 - selfdestruct no longer deletes contracts! (unless they were created in the exact same transaction that self destructs them)