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

StateService: broken findstates handler in case of destroyed/updated contract #650

Closed
AnnaShaleva opened this issue Oct 8, 2021 · 4 comments · Fixed by #654
Closed

StateService: broken findstates handler in case of destroyed/updated contract #650

AnnaShaleva opened this issue Oct 8, 2021 · 4 comments · Fixed by #654

Comments

@AnnaShaleva
Copy link
Member

Describe the bug
The new findstates RPC API introduced in #638 seems to be broken. The reason is in this and this lines of the method. findstates tries GetProof for historical state, but GetProof asks ContractManagement for the contract ID. As a result, for those contracts that have been destroyed and for the historical states of that contracts findstates will throw an exception, because ContractManagement is not able to get historical contract ID of destroyed contract.

Expected behavior
findstates should get historical proof, i.e. fetch historical contract ID from MPT (using GetHistoricalContractState method) to get proof for the first and the last states.

Platform:

  • Version: StateService, current master (606bd27).
@AnnaShaleva AnnaShaleva changed the title StateService: broken findstates handler in case of destroyed contract StateService: broken findstates handler in case of destroyed/updated contract Oct 8, 2021
@AnnaShaleva
Copy link
Member Author

The same problem may happen while trying to find the historical states of the updated contract if its hash has been changed.

@cloud8little
Copy link
Contributor

The same problem may happen while trying to find the historical states of the updated contract if its hash has been changed.

N3 will not change the contract hash when update.

@ZhangTao1596
Copy link
Collaborator

We should use GetHistoricalContractState.

@AnnaShaleva
Copy link
Member Author

The same problem may happen while trying to find the historical states of the updated contract if its hash has been changed.

N3 will not change the contract hash when update.

Thank you, forgot about it. Then the issue is relevant for destroyed contracts only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants