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

feeDistributor vat is not ugpradable #8729

Open
warner opened this issue Jan 9, 2024 · 4 comments
Open

feeDistributor vat is not ugpradable #8729

warner opened this issue Jan 9, 2024 · 4 comments
Labels
bug Something isn't working contract-upgrade Inter-protocol Overarching Inter Protocol

Comments

@warner
Copy link
Member

warner commented Jan 9, 2024

While looking at #8499 (comment) . and thinking about how v28-feeDistributor would react under upgrade, we noticed that v28-feeDistributor is not ugpradable.

v23-feeDistributor has code which talks to the timer service and creates a notifier during startDistributing. However this function is called only from makeFeeDistributor, which creates ephemeral creatorFacet and publicFacet objects (using Far()). So this contract instance is not upgradable: if we were to deploy any new version of v23-feeDistributor, these facets would be abandoned, making them unavailable for clients.

Since we can't upgrade v23-feeDistributor, we'll need to replace it, somehow, by convincing any clients to use a different vat, and then terminate the old one.

I didn't find any other tickets describing our plan to replace this code, so I figured I should start a new one.

cc @Chris-Hibbert

@dckc
Copy link
Member

dckc commented Jan 9, 2024

Um... did we miss this one in the bulldozer planning somehow? No... we decided it was OK:

"cron job" with no important state. can terminated and replaced at will.
-- #5795

// can be replaced instead of upgraded
'auctioneer',
'feeDistributor',

I think there are no clients.

@Chris-Hibbert
Copy link
Contributor

The feeDistributor may only be used by PSM and vat-bank.

@dckc
Copy link
Member

dckc commented May 15, 2024

feeDistributor collects from vaultFactory and sends to reserve; so it's a client of those 2.

const collectorKit = {
vaultFactory: E.get(vaultFactoryKit).creatorFacet,
};

PSM could generate fees, but it doesn't, so we didn't write it up, AFAICT.

feeDistributor 's only client is the time service, I think.

@Chris-Hibbert
Copy link
Contributor

The feeDistributor does all the work, and knows both the payers and payees. Neither of those has any knowledge of the feeDistributor.

The bootstrapSpace has creatorFacets for the payers, which have a makeCollectFeesInvitation() method. It also knows how to make depositFacets for the recipients of the funds.

To replace (not upgrade) the feeDistributor, just create a new one, and register it as the feeDistributor

  feeDistributorKit.resolve(
    harden({ ...instanceKit, label: 'feeDistributor' }),
  );
  feeDistributorP.resolve(instanceKit.instance);

The only current provider of fees is vaultFactory, and the recipients are current configured as

      keywordShares: {
        RewardDistributor: 0n,
        Reserve: 1n,
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contract-upgrade Inter-protocol Overarching Inter Protocol
Projects
None yet
Development

No branches or pull requests

3 participants