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

[FEATURE]: Store number of updates of a specific contract #24

Closed
1 task done
joticajulian opened this issue Jan 12, 2023 · 6 comments
Closed
1 task done

[FEATURE]: Store number of updates of a specific contract #24

joticajulian opened this issue Jan 12, 2023 · 6 comments
Labels
enhancement New feature or request stale

Comments

@joticajulian
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

New feature

As a smart contract developer I would like to know how many upgrades a specific contract has had.
Use case example: Fogata.
Before adding a new pool to the list of approved pools we have to check that the storage of the pool has not been manipulated in the past by a previous contract. Then we have to check that the submitted contract has not been upgraded in the past.
Right now, we check this by reading the history of transactions. But I would like to perform this check in a decentralized way.

Anything else?

No response

@joticajulian joticajulian added the enhancement New feature or request label Jan 12, 2023
@mvandeberg
Copy link
Member

Unlike koinos/koinos-chain#806, this issue is a bit more involved.

the storage of the pool has not been manipulated in the past by a previous contract.

I don't think this is the responsibility of the chain. Rather, the pool contract should be checking its own state and emitting a "success" event if everything looks good. Since your pool contract is not intended to be upgraded, I would focus on your second point.

Then we have to check that the submitted contract has not been upgraded in the past.

This is do-able, but it is not the responsibility of the chain. I would rely on Contract Meta Store to give current and history information on smart contracts.

But I would like to perform this check in a decentralized way.

Reading transaction history is still decentralized. You can cryptographically prove inclusion of the transaction.

@joticajulian
Copy link
Author

Thanks Michael. Could you give an example of how can I make this cryptographic proof?

@koinos-ci
Copy link

This issue is stale because it has been open for 30 days with no activity.

@mvandeberg
Copy link
Member

Thanks Michael. Could you give an example of how can I make this cryptographic proof?

If the contract meta store recorded which transaction included the update, you can look up which block included the transaction and the blockchain itself is the proof.

I am moving this issue to contract meta store as the correct place to add this information.

@mvandeberg mvandeberg transferred this issue from koinos/koinos-chain Feb 22, 2023
@mvandeberg mvandeberg removed the stale label Feb 22, 2023
@koinos-ci
Copy link

This issue is stale because it has been open for 30 days with no activity.

@koinos-ci koinos-ci added the stale label Jun 2, 2023
@koinos-ci
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@koinos-ci koinos-ci closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants