-
Notifications
You must be signed in to change notification settings - Fork 25
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
Migrate old attestations #979
Migrate old attestations #979
Conversation
Transform a TransactionSummary without version into a TransactionSummary v1 | ||
""" | ||
@spec transform_1_0_8_summary(t()) :: t() | ||
def transform_1_0_8_summary(tx_summary = %__MODULE__{version: 1}), do: tx_summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it in this file ? I think the migration should have this function, hence do no need to alter this file after the upgrade, so the function will be contextualized for the migration only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be clearer to use a Slot.transform/2
and TransactionSummary.transform/2
which just do transformation of data structure for a given version.
Add a control to prevent attestation v1 after a specific date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested with the given instructions.
When I applied the release 1.0.8, this error started to pop every minute:
But the nodes were working fine I believe, I tried to do a few transfer and no issue.
But then I opened the beacon explorer and impossible to read a summary that happened before the release 1.0.8.
The explorer display loading
and the nodes display this error
Hope it helps
093e93f
to
4715913
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested with new changes, migration worked fine
Description
This issue handle the migration from old transaction summary and replication attestation to the new ones added by #941
It adds a migration script to transform old summary aggregate and summary with the new transaction summary containing the validation stamp checksum
Also migrate the current slots stored in summary cache with the new version.
Slot stored in subset is transformed only when an other process request it
Fixes #956
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
First need to create a release on version 1.0.7.
Do do so, go on develop and remove the commits from pr #941 and #927, you can do an interactive rebase
git rebase -i HEAD~30
and drops the following commitsThen runs these commands :
Here you can start the 2 nodes created:
./test_release_node1/bin/archethic_node console
ARCHETHIC_CRYPTO_SEED=node2 ARCHETHIC_P2P_PORT=3003 ARCHETHIC_HTTP_PORT=4001 ARCHETHIC_HTTPS_PORT=5001 ./test_release_node2/bin/archethic_node console
Now you need to prepare the branch to the new version. You have to update the version number and also remove a code change that will fail (as we already run the new version)
You can apply this patch to do so :
patch.txt
git apply patch.txt
(You can commit this patch to avoid applying it each time you switch branch)
Create the new release 1.0.8
./scripts/test-release.sh -p
You can wait the 2 nodes are authorized and create some summary aggregate.
Then execute the new upgrade
./scripts/test-release.sh -u
The upgrade should pass successfully without error, you can access to old summaries using the explorer (make sure the data is not cached)
Next summary time should create summary without error (You may have error with StatsCollector which was not started by default in the appup file)
Checklist: