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

Condor rc3 #142

Closed
wants to merge 29 commits into from
Closed

Condor rc3 #142

wants to merge 29 commits into from

Conversation

deuszex
Copy link
Contributor

@deuszex deuszex commented Jun 21, 2024

2.0.0-rc3 compatible.
Migration entrypoints for balance and allowance keys to move from old Key formats to new ones (AddressableEntity).
Events:
EventsMode::CES events included (forked original to update to rc3).
EventsMode::Native events included (Casper Native events).
EventsMode::NativeNCES (uses both Native and CES eventing).
Compiles on latest rust.

Added 1.5.6 fixture(state snapshot) to test migration from 1.5.6 to 2.0.0-rc3.

TODO: Fixture guide/tutorial.

Added entrypoint:

  • migrate_user_allowance_keys:
  • migrate_user_balance_keys
  • migrate_user_sec_keys
    The above entrypoints change the stored keys from the old style (Key::Hash/Key::Account) to the new one (Key::AddressableEntity) which will be used in the contract going forward. The entrypoints also take events and revert boolean arguments. Supplying false to the events argument turns the eventing off during the current calling of the entrypoint, since the size of the events can be rather large depending on number of arguments provided. Supplying true as the revert argument on the other hand will cause the call to immediately revert upon meeting an error, which may help in determining the point of failure if encountered one.
  • change_events_mode (needs testing): to change the events mode without needing to upgrade the whole contract.

deuszex and others added 12 commits April 25, 2024 17:48
Makefile Outdated Show resolved Hide resolved
cep18/src/constants.rs Outdated Show resolved Hide resolved
gRoussac and others added 5 commits June 24, 2024 16:25
* native eventing

* change_event_mode

* native eventing done
…ondor-rc3

# Conflicts:
#	cep18/src/main.rs
#	cep18/src/modalities.rs
#	tests/src/migration.rs
…dor-rc3

# Conflicts:
#	tests/src/utility/installer_request_builders.rs
@gRoussac gRoussac linked an issue Jul 2, 2024 that may be closed by this pull request
cep18/src/main.rs Show resolved Hide resolved
tests/src/utility/constants.rs Show resolved Hide resolved
…age, should have been this way to begin with
@sczembor
Copy link

sczembor commented Jul 4, 2024

The current approach relies on a user-provided key map, which introduces the risk of errors and could be cumbersome for larger migrations. Also, it doesn't account for potential "race" if the contract is used post condor and before/while the migration process.

I'd like to propose an alternative "on-demand" migration. This approach would:

  1. Trigger migration automatically whenever a account or contract (AddressableEntity) interacts with the smart contract.
  2. Reconstruct the old key (AccountHash, ContractHash) and transfer the balance, allowances to the new AddressableEntity key structure if the migration didnt already occurred.

This eliminates the need for a manual key map and reduces the risk of errors. While it might add some complexity, I believe it offers a more robust and scalable solution.

I'm happy to discuss it and see your point of view. @deuszex @gRoussac

@deuszex
Copy link
Contributor Author

deuszex commented Jul 4, 2024

@sczembor That is the so collad "lazy migration" that we have discussed already on our meetings on which you are also present, and as I've said on the mentioned meetings, these decision will go through the proper chain of command, when the relevant personnel are available.

@deuszex
Copy link
Contributor Author

deuszex commented Jul 23, 2024

Closing in favour of another PR

@deuszex deuszex closed this Jul 23, 2024
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 this pull request may close these issues.

CEP18 / Migration to Condor 2.0 - Hash Types Update
4 participants