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

feat: Add created/updated at block heights to registry #458

Merged
merged 8 commits into from Jan 4, 2024

Conversation

morgsmccauley
Copy link
Collaborator

@morgsmccauley morgsmccauley commented Dec 19, 2023

This PR adds the created_at_block_height and updated_at_block_height fields to IndexerConfig within the registry contract. The motive behind this is to provide Coordinator V2 with a way for comparing the actual and desired states of the system, i.e. if there is a mismatch between the registry and the system, action should be taken. Without versions, there is no way of making this comparison.

Compilation Errors

I ran in to several issues trying to compile the wasm32 binary, and have outlined all these issues in near/near-sdk-rs#1125, as well as in the README.md so that the fixes are documented. These fixes are a bit janky, but I've tested the deployed contract and all seems to be ok.

These have been resolved, see: #458 (comment)

Account Roles Migration

I've also included account_roles in this migration as we have some incorrect accounts as Owners (pavelnear.near). All owners will be wiped and re-written from the contract default state. All Users will remain.

Coordinator V1

Coordinator V1 has been tested to ensure that it can still parse the registry after these new fields have been applied.

@morgsmccauley morgsmccauley linked an issue Dec 19, 2023 that may be closed by this pull request
@morgsmccauley morgsmccauley force-pushed the 415-add-createdupdated-at-timestamps branch from 7553a2f to 4ae19e4 Compare December 19, 2023 18:04
@morgsmccauley morgsmccauley changed the title 415 add createdupdated at timestamps 415 add created/updated at timestamps Dec 20, 2023
@morgsmccauley morgsmccauley changed the title 415 add created/updated at timestamps feat: Add created/updated at block heights to registry Dec 20, 2023
@morgsmccauley morgsmccauley marked this pull request as ready for review December 20, 2023 07:57
@morgsmccauley morgsmccauley requested a review from a team as a code owner December 20, 2023 07:57
@morgsmccauley morgsmccauley force-pushed the 415-add-createdupdated-at-timestamps branch from 77268d7 to 8a791a7 Compare December 20, 2023 07:58
@morgsmccauley
Copy link
Collaborator Author

@roshaans will these new fields create any problems on the frontend side? I'd expect not because it is an expanding change, rather than removing/updating existing fields?

@morgsmccauley
Copy link
Collaborator Author

The compilation errors originally mentioned in the PR description have now been resolved.

These errors were related to the compilation of near-primitives to wasm32, the smart contract target. This dependency was included as a default feature for the shared registry-types crate, meaning it would be included in the compilation. It has since been removed and now must be explicitly listed as a feature, hence the change to block-streamer.

@roshaans roshaans self-requested a review January 3, 2024 19:02
Copy link
Contributor

@roshaans roshaans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Able to build properly! These changes also do not seem like they would affect the frontend in anyway so LGTM 💯

@morgsmccauley morgsmccauley merged commit ed72374 into main Jan 4, 2024
8 checks passed
@morgsmccauley morgsmccauley deleted the 415-add-createdupdated-at-timestamps branch January 4, 2024 19:54
@morgsmccauley
Copy link
Collaborator Author

morgsmccauley commented Jan 5, 2024

This has been deployed to Dev, I'll let it sit for a couple days and then deploy to Prod if all is ok.

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.

Add created/updated at timestamps
3 participants