lotus icon indicating copy to clipboard operation
lotus copied to clipboard

Events: Fields specifier for {Subscribe,Get}ActorEventsRaw is ignored if it has no values

Open rvagg opened this issue 7 months ago • 0 comments

Ref: https://github.com/filecoin-project/lotus/pull/12261#discussion_r1682707557

Re: https://github.com/filecoin-project/lotus/blob/3daff2ed8064b46127c1f7db2f891ab869c18cb5/chain/types/actor_event.go#L26-L28

We claim that it will match only the key if the values are empty.

But in the implementation we do: https://github.com/filecoin-project/lotus/blob/3daff2ed8064b46127c1f7db2f891ab869c18cb5/chain/events/filter/index.go#L510

i.e. if there are no values, we do nothing, so they are ignored. We need to either fix the comment or fix the behaviour. The right thing is probably to fix the behaviour, I think this can be done by moving the len(vals) check down to enclose the subclauses section in that code, but we need tests for this.

rvagg avatar Jul 19 '24 00:07 rvagg