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

refactor(platform)!: document creation/update/deletion does not refetch contract #1840

Merged

Conversation

QuantumExplorer
Copy link
Member

Issue being fixed or feature implemented

Document creation, update and deletion all told drive about the contract by setting the contract id. Drive would then refetch the contract from disk.

Even though most of the time it would fetch it from cache, this still was not ideal, because the processing cost of a fetch from cache is the same as a fetch from disk.

What was done?

A new type was created that encapsulates all types on data contract info, and we made the document operations in drive more straightforward hiding away most of the complexity. Now there are just a single operation allowed for adding, updating, or deleting.

How Has This Been Tested?

Tests continue to pass.

Breaking Changes

Since we no longer fetch the contract in drive, drive will report less processing costs, this means that this is a breaking change.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@QuantumExplorer QuantumExplorer requested a review from shumkov as a code owner May 7, 2024 17:03
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

light utACK; generally seems to be a fine and correct refactor; there are a few things I wish were done in other PRs to make this more trivial to review. I find it is unlikely there are issues introduced here that wouldn't be caught by tests.

See comments

@QuantumExplorer QuantumExplorer merged commit 2b56263 into v1.0-dev May 7, 2024
35 checks passed
@QuantumExplorer QuantumExplorer deleted the refactor/documentCreationDoesNotRefetchContract branch May 7, 2024 17:42
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.

2 participants