Actor events for the verified registry, miner, and market actors (FIP-0083) #754
Replies: 23 comments 83 replies
-
Design question: how much data should events include? E.g., for a new FIL+ allocation, should the event include all the allocation fields, or a subset, or only the ID?
What tradeoff here might be appropriate if we consider applying it to all meaningful transitions in the remaining built-in actors (e.g. miner sector state changes & faults, datacap token)? |
Beta Was this translation helpful? Give feedback.
-
Design question: how should we designate event types? An event comprises a sequence of key/value pairs, where the value is optional. Because the order is specified, either position or a special key could be used for significant fields like a type specifier. Version 1:
Version 2:
Is the first position convenient enough to distinguish a type field? Would it be really annoying for clients that attempt to deserialize into an unordered map? Should we use a valueless key here to force clients to handle it, since it could in any case arise at any position? If we use a special key, what should it be? |
Beta Was this translation helpful? Give feedback.
-
Adding the following Sector lifecycle events to the Miner Actor in the next PR:
We need both the Miner Actor Id and the Sector Number here to uniquely identify the sector that has been pre-commited. Ditto for the Sector Proven event below.
This will be emitted for each sector that is proven i.e. each sector for which a "prove-commit" is received and verified.
Note that the |
Beta Was this translation helpful? Give feedback.
-
I've retitled this discussion post to expand scope to the miner and market actors, as well as verified registry. This makes a nice set to target in one FIP. |
Beta Was this translation helpful? Give feedback.
-
Thanks @aarshkshah1992 for the draft FIP PR: #872 Moving some design questions from FIP editorial review to here to give more space for discussion.
|
Beta Was this translation helpful? Give feedback.
-
The current draft has an inconsistency in the fields provided with verifreg vs market events. These workflows are quite similar in nature so I think we probably want a similar event schema, unless we can articulate a good reason why not. The verifreg events currently all have the allocation/claim ID and the client and provider ID (see above). The market deal-publish event has similar, but then subsequent deal events only specify the deal ID. The market approach does seem minimally sufficient: a party (e.g. a client) can filter for their ID in the deal-publish event, and accumulate a list of deal IDs they are then watching for subsequent events. But this does seem a bit less easy than just being able to filter for all the events on client ID, as they could for the verifreg events. So which should we choose? My current thought is that the ease-of-use justifies a couple of integer fields in each event, so following the verifreg example. |
Beta Was this translation helpful? Give feedback.
-
What should we include in sector activation events? The minimum of a sector ID is there, with the idea that other data can be looked up in state. The sector data commitment (CommD, unsealed CID) can't be looked up in state, because we don't store it. But this is likely to be useful to some off-chain groups like aggregators, indexers etc. Perhaps we should include it? Noting @Stebalien's comments above, full support for any possible use case would require emitting all the sector metadata, since the sector could be terminated in the same epoch and the data gone. But I don't think this is practically worthwhile. |
Beta Was this translation helpful? Give feedback.
-
The new We should ideally include the |
Beta Was this translation helpful? Give feedback.
-
Any projection / estimation on the increase of gas for each messages? |
Beta Was this translation helpful? Give feedback.
-
much love for this. i think events for build in / native actors are a great idea |
Beta Was this translation helpful? Give feedback.
-
Adding some comments from @jennijuju on https://github.com/filecoin-project/FIPs/pull/872/files here for discussion:
|
Beta Was this translation helpful? Give feedback.
-
@anorth Do we need the |
Beta Was this translation helpful? Give feedback.
-
@rvagg has a comment on the FIP we should discuss
Should we be using DAG-CBOR over plain CBOR here @Stebalien @anorth ? |
Beta Was this translation helpful? Give feedback.
-
Another thing I think would be nice to be captured in the FIP is, if in the future, some actor events' payload needs to be updated, how would the client (event consumers) integrate them? |
Beta Was this translation helpful? Give feedback.
-
Starboard enthusiastically supports an events mechanism for built-in actors such as the one proposed in FIP-0083. Our biggest challenge in providing reliable and accurate analytics for the Filecoin ecosystem is that the data that we work with is often provisioned in terms of state transitions. It can be rather tricky to analyse things such as market deal state, where there is no direct information about what the before or after states even are. After implementation of FIP0060, we can currently only definitively tell if a deal is terminated up to the frequency of the cron job, currently 30 days – clearly not ideal. An event mechanism would circumvent this limitation very efficiently and help Starboard to provision precise and unambiguous analytics for the community. |
Beta Was this translation helpful? Give feedback.
-
Hello from a potential consumer of the new actor events 👋🏻 In SPARK, we are building a network of checker nodes to verify whether data stored in Filecoin storage deals can be retrieved. For example, FIL+ LDN requires that stored data should be readily retrievable on the network and this can be regularly verified (though the use of manual or automated verification that includes retrieving data from various miners over the course of the DataCap allocation timeframe). As the first step, a checker node needs to pick a storage deal that is valid and was created by one of the clients with FIL+ LDN allocation. This is very difficult to implement in a decentralised and trustless way.
I am hoping that the new Actor events will make it easier to maintain an off-chain database of all valid deals. After reading the current proposal, it's unclear to me how an event listener can obtain the full Deal Proposal data based on the payload of a received Market Actor event.
Clearly, the pair Does the int value in For SPARK, we need to obtain the full Deal Proposal structure - see How can we achieve that? Is our use case a valid one for actor events, or should we look for different ways how to achieve what we need? An idea for a solution that would be easy to use for us: What if |
Beta Was this translation helpful? Give feedback.
-
Moving a discussion from code review filecoin-project/builtin-actors#1491 (comment). @aarshkshah1992's first attempt at including the piece information in sector activation events for the existing pre-FIP-0076 activation methods involved calling to the market actor to look up the deals and compute piece information from them. I do not think the cost and complexity of making a new call to the market actor to get this information is justifiable. These methods already call BatchActivateDeals at the market actor once to activate the deals, and get some information back. This info does include the piece CIDs for verified deals, but not for unverified ones. So it's not sufficient to satisfy the events. The BatchActivateDeals method also supports partial success: it can fail to activate some deals. It fails on a grouped-by-sector basis, and doesn't return any deal information for the failures. If the miner actor will fail to activate the sector if the deal activation fails, then this lack of information is probably ok. I think the pre-FIP-0076 methods both do this. There's no problem for the FIP-0076 activation methods because the piece information is explicit in the method parameters. I see two viable options:
Option 2. is definitely simpler! I'm a bit averse to going out of our way to do work to enable new functionality for legacy methods. The motivation for these events in the first place was FIP-0067, which will deprecate the legacy methods. But complete deprecation may take some time and I can see the value in uniform support for the functionality. |
Beta Was this translation helpful? Give feedback.
-
Moving discussion initiated by PR #955 which proposes adding piece CID and size to verified registry My summary of the motivation is: to remove the need for state inspection at the time of the I think it unlikely that an attempt to remove the need for state inspection is likely to succeed generally, except in narrow cases. There will be more questions asked of the data that require reading state to fetch some other field not contained in the event. Even the hypothetical questions posed by the PR can't properly be answered without reading out the claim sector ID and joining claim information with sectors (to see if they're still live). So here is an argument in similar form for including the sector ID, and the same might be made for term, and where does it stop? To repeat an observation I made above:
On thing that is new since the beginning of this discussion is that we have quantified the gas cost. Built-in actor methods tend to be doing a lot, so the cost of events is very small as a proportion. Perhaps the minimalist approach isn't right here, and we should just include all the near-to-hand information with all events? That will add bloat to chain size, etc, but if (big if) events are priced correctly this is in theory fine and limited by gas market dynamics. The existing design approach here (and in many places) is to make things like off-chain analysis possible, but not pay more chain validation costs to make them easy. The ecosystem should only need two or three parties to do the complicated state inspection and produce data for other parties to consume. I acknowledge that there might be some cases, including this one, where adding a small bit of work to the thousands of chain validators is globally more efficient than a couple of parties performing a much more complicated task given less structured data, but analysing these costs as protocol designers isn't feasible. So:
|
Beta Was this translation helpful? Give feedback.
-
Hey folks! Hello from datacapstats.io! We are investigating using events for fetching all the necessary data to track datacap flow. The problem is that for the first 2 paths the only related event is verifier_balance and that doesn't have any information about which operation happened. Is it posible to add 2 new events to track these 2 flows? Something like (verifier_received_datacap, verifierID, amount) and (client_received_datacap, clientId, verifierID, amount) ? |
Beta Was this translation helpful? Give feedback.
-
After receiving additional feedback on the information currently available in events, including from a raised awareness of the implications of DDO in network version 22 on observability concerns as it inches toward us, we're back again with a new proposal that we're hoping to get approved and shipped with network version 22. #964. Given the tight time constraints and concerns about stability, we've attempted to craft a line between "near-to-hand" information (i.e. low-risk, minimal code changes) and "maximally useful" when considering the requirements we are hearing from parties concerned about a DDO world. A lot of the feedback we have received is related to the verified registry and the difficulties in tracking claims, pieces, SPs and clients and their relationships. The events, as they are currently structured, require reactive state inspection to provide enough context to make sense of them, such as the example of claims outlined in the previous attempt at expanding events in #955. |
Beta Was this translation helpful? Give feedback.
-
Regarding the proposal in #955 to add I really don't like this. What's a client doing in an event about verifier balance? How will this extend to future methods that might, e.g. batch distributions of data cap to clients? However I can see that it's solving a linkage problem that @smooth-operator and @willscott mention. This is trying the squeeze an extra field in to make a "small" change that should really be a larger one. Changes to a verifiers balance are one thing, allocating data cap to a client is another thing. They should have separate events. A better design here is probably:
The AddVerifiedClient operation would then fire two events. (A hypothetical batched one would fire one event per client, plus one for the aggregated delta to the verifiers balance). The event should correspond to logical state changes, not the method APIs that present the various paths into those state changes. This is a larger change that may not be reasonable to squeeze into a post-last-call FIP. We could do it in a follow-up FIP with time to think it through thoroughly. Things have been getting by without this up until now. I totally see the value in improving it, but object to making a change that isn't the final form we'd choose after a thorough design discussion. |
Beta Was this translation helpful? Give feedback.
-
Regarding #955 add previous values for overwritten state (verifier balance, claim term max) This is a tradeoff that I think is worth discussing more, I'm not sure. The events as a collection would already have complete information without these previous values. The previous value is whatever the new value was from the previous event. No state inspection is required to find the previous value. Including previous values is a further accomodation to consumers to save them from even remembering/indexing past events. Convenient for the few clients that will use each particular field, yes, but is it worth the gas/code/testing costs? I think this might be taking the convenience too far. |
Beta Was this translation helpful? Give feedback.
-
Regarding #955 add expiration to sector activation/update I think we should avoid adding this if possible. Expiration is one part of sector lifecycle that I expect to change significantly in the future. The concept of expiration could also be easily misunderstood by consumers.
|
Beta Was this translation helpful? Give feedback.
-
FIP-0049 introduced an events mechanism for actors, initially motivated to allow the EVM actors to support events from EVM smart contracts. Such events from built-in actors would be also be useful for clients and applications. This discussion is to determine the schemas and conventions for such events, to be eventually formalised in one or more FIPs.
To spur this discussion, I have prototyped an implementation of events for the verified registry actor. We expect to implement similar events for most of the built-in in actors in time. I chose the verified registry as a target because it's relatively simple, the events will be useful immediately, and are probably required for future direct data onboarding capabilities (they answer the question: how does an SP know an allocation was made?).
The prototype is in development at filecoin-project/builtin-actors#1320. I will update it as discussion here converges.
Beta Was this translation helpful? Give feedback.
All reactions