yearn / veYFI

Voting YFI
75 stars 38 forks source link

Question: BaseGauge.queuedRewards #102

Closed rareweasel closed 2 years ago

rareweasel commented 2 years ago

I know we added an event in this pr, but I wonder how can we know we set queuedRewards to 0 here or here or _amount here.

pandadefi commented 2 years ago

queuedRewards

Isn't it possible to read the value on every block?

_amount

Can't be zero and should match the transfer amount.

rareweasel commented 2 years ago

queuedRewards

Isn't it possible to read the value on every block?

_amount

Can't be zero and should match the transfer amount.

I meant when we set queuedRewards = 0 or queuedRewards = _amount:

Yes, it is possible to call the function to get value in the subgraph, but it makes too much slower the sync process (more if we call it every block). That's why it would be better if we emit an event.

pandadefi commented 2 years ago

I prefer we don't add the other event, on one hand, we have a more gas expensive tx on the other it takes longer to index, I prefer we don't spend more gas.

rareweasel commented 2 years ago

And if we move this event at the end of the function to include both values _amount and queuedRewards?