arc icon indicating copy to clipboard operation
arc copied to clipboard

Cannot determine type of proposals being executed

Open dkent600 opened this issue 7 years ago • 2 comments

Several schemes fire a ProposalExecuted event for more than one type of proposal, without indicating which proposal type is being executed.

For example, SchemeRegistrar has two types of proposals: one to add a scheme, one to remove. Since ProposalExecuted is fired for both, and there is no parameter to distinguish the type of proposal, it is not possible to get/watch execution events separately for either adding or removing schemes. Nor is it possible to know, given just the proposalId, what type of proposal has been executed.

So I would like to propose that we break ProposalExecuted into a separate event for each type of proposal. Thus SchemeRegistrar would have two events: AddSchemeExecuted and RemoveSchemeExecuted.

Similarly for UpgradeScheme and GlobalConstraintRegistrar.

Alternatives to this, in my order of preference:

  1. include the proposal type as a parameter to the existing ProposalExecuted event
  2. (less efficient) don't remove proposals from the proposals mapping when they are executed

dkent600 avatar May 02 '18 15:05 dkent600

@orenyodfat I wonder if you could comment on this with questions and your preferred approach? Thanks.

dkent600 avatar May 09 '18 21:05 dkent600

I tend to option 1.

orenyodfat avatar Jul 03 '18 09:07 orenyodfat