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

remove reallocate from ZCF #6678

Closed
Chris-Hibbert opened this issue Dec 15, 2022 · 11 comments · Fixed by #7136 or #7903
Closed

remove reallocate from ZCF #6678

Chris-Hibbert opened this issue Dec 15, 2022 · 11 comments · Fixed by #7136 or #7903
Assignees
Labels
code-style defensive correctness patterns; readability thru consistency Dapp & UI Support devex developer experience enhancement New feature or request hygiene Tidying up around the house technical-debt v1_triaged DO NOT USE vaults_triage DO NOT USE Zoe Contract Contracts within Zoe

Comments

@Chris-Hibbert
Copy link
Contributor

Chris-Hibbert commented Dec 15, 2022

What is the Problem Being Solved?

#6577 Added a new reallocation API for Zoe, but didn't convert all the uses in existing contracts to the new version.

Description of the Design

#7136 convered all the uses of reallocate, incrementBy, and decrementBy in agoric-sdk, except for the one in atomicRearrange and tests.

Left to do is :

  • remove from dapps
  • inform third-parties that the old version is going away
  • move atomicRearrange onto ZCF
  • remove realllocate from ZCF

Security Considerations

The new API is more robust. Version migration has to be done carefully.

Test Plan

This ends by deleting the old APIs, which is sufficient test that the methods are gone.

@Chris-Hibbert Chris-Hibbert added enhancement New feature or request hygiene Tidying up around the house Zoe Contract Contracts within Zoe Dapp & UI Support code-style defensive correctness patterns; readability thru consistency technical-debt devex developer experience contract-api-change external contract API changes (that impact clients) labels Dec 15, 2022
@Chris-Hibbert Chris-Hibbert self-assigned this Dec 15, 2022
@dckc
Copy link
Member

dckc commented Dec 16, 2022

How is this a contract-api-change?

Oh... I guess the label wasn't clear. It doesn't mean changes to things like the Zoe API. It means changes to the external API of contracts such that clients (such as web UIs) are affected.

I updated the description.

@dckc dckc removed the contract-api-change external contract API changes (that impact clients) label Dec 16, 2022
@ivanlei ivanlei added the vaults_triage DO NOT USE label Jan 3, 2023
turadg added a commit that referenced this issue Mar 8, 2023
#6678 will remove it completely but meanwhile we can ensure it's only used by ZCF
@mergify mergify bot closed this as completed in #7136 Mar 9, 2023
@turadg
Copy link
Member

turadg commented Mar 9, 2023

I think Mergify got confused by "This doesn't close #6678" in the PR.

@turadg turadg reopened this Mar 9, 2023
@turadg turadg changed the title replace use of stagings with atomicTransfers remove reallocate from ZCF Mar 9, 2023
@erights
Copy link
Member

erights commented Mar 9, 2023

I think Mergify got confused by "This doesn't close #6678" in the PR.

I've had this problem several times. I hate "guess my syntax" user interfaces. Do we know what the actual syntax is for a PR to say that it would close an Issue, so that we can reliably avoid saying that when it is not what we want to say?

@turadg
Copy link
Member

turadg commented Mar 9, 2023

I was wrong about Mergify. GitHub attributes the action to the account that merged the PR. The magic syntax is https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

@erights
Copy link
Member

erights commented Mar 9, 2023

Thanks, that explains it. The cases I recently ran into were at #5903 (comment)

due to the text

Would enable us to fix #5903

Apparently, the use of the word "fix" followed by the bug number was an adequate signal.

@Chris-Hibbert
Copy link
Contributor Author

Chris-Hibbert commented Jun 6, 2023

Next steps:

  • move atomicRearrange inside Zoe
  • deprecate pervasively: reallocate, getStagedAllocation, and hasStagedAllocation.
  • remove uses of those methods from our code.
  • wait
  • remove reallocate, et. al.

The first three can be in a single release, or successive releases. There should be at least a short period between those and removing the older approach.

@dckc
Copy link
Member

dckc commented Jun 6, 2023

update docs too

@Chris-Hibbert
Copy link
Contributor Author

update docs too

Already in progress.

@Chris-Hibbert
Copy link
Contributor Author

@turadg,
The next step in this process involves making a change to ZCF, to add atomicRearrange, and a bunch of tooling to actually make it possible to upgrade zoe and zcf to install those changes on chain. The first part of that is #7900, which makes the change to ZCF. That is accompanied by #7901, #7903, and #7904, which upgrade three of the core contracts to make use of that change. None of those are urgent, so we'll say no more about them at this point.

In order to install the change to ZCF on chain, we have to modify Zoe to support a mutable version of ZCF (#7946), and then we have to provide scripts that can be invoked by core-eval (#7966). This is complicated by the fact that 7966 will be merged into a state of the tree that already includes the new Zoe & ZCF, so its accompanying test doesn't actually verify that an upgrade from the status quo ante to the goal state will succeed.

In order to validate that, we have a separate PR (#7969). It includes a copy of the same set of tooling, and installs bundles built by 7966 representing the target state of Zoe & ZCF. The test that validates the upgrade has some minor validations between 7966 and 7969, since the latter installs pre-built bundles (and the test results are expected to be slightly different.)

My expectation is that that we'll now proceed to review and merge #7900, #7946, and #7966.

The test in #7969 is intended to be convincing validation that the code in 7900 and 7946 will succeed when they are applied on-chain. A follow-up task is to build an upgrade test based on 7969 that applies the upgrade in the docker test environment.

After that, the remaining steps of urging developers to migrate and removing support tor zcf.reallocate() and stagings can be taken after a short pause.

@Chris-Hibbert
Copy link
Contributor Author

Chris-Hibbert commented Jun 23, 2023

After #7900, #7946, and #7966, the following work will remain:

@turadg
Copy link
Member

turadg commented Jun 23, 2023

Thanks for writing that up @Chris-Hibbert . I put the "get onto chain" requirements into #7982

mergify bot added a commit that referenced this issue Sep 4, 2024
refs: #6678
refs: #7900

## Description

update VaultFactory to use zcf.atomicRearrange.

This change **must not** be pushed to the chain before #7900.

### Security Considerations

None

### Scaling Considerations

None

### Documentation Considerations

None

### Testing Considerations

None

### Release considerations

This requires a change to Zoe (#7900). Since VaultFactory gets upgraded separately from Zoe, this is staged as a separate PR.  Once #7900 is on chain, this update can be made, even if it's in the same release cycle, as long as Zoe is upgraded first. This change is independent of changes to other contracts.
mergify bot added a commit that referenced this issue Sep 4, 2024
refs: #6678
refs: #7900

## Description

update Auction to use `zcf.atomicRearrange()`.

This change must not be pushed to the chain before #7900.

### Security Considerations

None

### Scaling Considerations

None

### Documentation Considerations

None

### Testing Considerations

None

### Release considerations

This requires a change to Zoe (#7900). Since the Auction gets upgraded separately from Zoe, this is staged as a separate PR. Once #7900 is on chain, this update can be made, even if it's in the same release cycle, as long as Zoe is upgraded first. This change is independent of changes to other contracts.
mergify bot added a commit that referenced this issue Sep 10, 2024
refs: #6678

## Description

We've already marked zcf.reallocate() as deprecated in many places, but I found another while searching on our docs site.

https://docs.agoric.com/reference/agoric-sdk/modules/agoric_zoe.src_contractFacet_types_ambient.html#type-declaration-4next/

### Security Considerations

None.

### Scaling Considerations

N/A

### Documentation Considerations

Cleaning up docs.

### Testing Considerations

N/A

### Upgrade Considerations

None.
@mergify mergify bot closed this as completed in #7903 Nov 7, 2024
@mergify mergify bot closed this as completed in ed76c8b Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-style defensive correctness patterns; readability thru consistency Dapp & UI Support devex developer experience enhancement New feature or request hygiene Tidying up around the house technical-debt v1_triaged DO NOT USE vaults_triage DO NOT USE Zoe Contract Contracts within Zoe
Projects
None yet
5 participants