flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[Storage] Use lockctx to store approvals

Open zhangchiqing opened this issue 6 months ago • 3 comments

Working towards https://github.com/onflow/flow-go/issues/7355. This PR addresses part of the second category:

  1. Existing usage of a lock within the storage layer (currently marked with TODO(7355) in https://github.com/onflow/flow-go/issues/7138)

This PR introduces the lockctx manager and uses it in storing the approvals. The lockctx manager helps to ensure we don't overwrite conflicting approvals for the same block.

This PR also removes the deprecated badger transaction models that stores approvals.

zhangchiqing avatar May 14 '25 19:05 zhangchiqing

Hey @zhangchiqing, it looks like this PR is replicating many of the changes added in https://github.com/onflow/flow-go/pull/7364, but in different commits without sharing Git history. Can you explain which set of changes you're planning to eventually include in master? From my perspective, it would make the most sense for this PR adding the Approvals storage module changes to extend https://github.com/onflow/flow-go/pull/7364, where lockctx is added.

If possible, I want to avoid a situation where we are simultaneously reviewing and modifying the same set of changes in two different PRs (this one and https://github.com/onflow/flow-go/pull/7364), because it's difficult to keep them consistent.

jordanschalm avatar May 29 '25 13:05 jordanschalm

@jordanschalm yeah, https://github.com/onflow/flow-go/pull/7364 is gonna be merged to feature branch, and stay there for a while. But I think the lock manager could be merged to master earlier, before the feature branch gets merged.

It's hard to cherry-pick your changes from 7364 into this PR, I tried but doesn't work, only managed to cherry-pick one commit. For the rest, I had to copy over the changes into this PR.

zhangchiqing avatar May 29 '25 16:05 zhangchiqing