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

feat(config): move Fevm.Events->Events, implement soft deprecation #11698

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Mar 8, 2024

Closes: #11679

The Fevm.Events config options don't make sense under Fevm, particularly now that they are for "actors" in general. @jennijuju and I thought that getting them moved to the new top-level Events in v1.26.0 is going to be the least painful option because the number of users who currently touch those options is restricted to a small number that are using the eth APIs. But now, with the new actor events APIs, the circle of users who may be touching these will increase. So best act now before we have more people with these config options set in the wrong place.

Although, I've implemented a soft deprecation here. Your old config will still continue to work but you'll get a stderr warning about it and how it will be removed in a future update. Your settings will be automatically migrated to the new location. So this technically shouldn't be breaking for anyone.

  • Introduce a moved:"To.New.Config" tag which prints a stderr warning when you use one of these, but will move any set value to the new location if the new location isn't already set itself.
  • Look for X is DEPRECATED to hold certain fields back from documentation.
  • Use toml:"omitempty" to prevent the default config output from having these deprecated values.

@rvagg rvagg requested a review from a team as a code owner March 8, 2024 11:20
@jennijuju
Copy link
Member

capture this in the changelog maybe?

Closes: #11679

* Introduce a `moved:"To.New.Config"` tag which prints a stderr warning when
  you use one of these, but will move any set value to the new location if the
	new location isn't already set itself.
* Look for `X is DEPRECATED` to hold certain fields back from documentation.
* Use `toml:"omitempty"` to prevent the default config output from having these
  deprecated values.
@rvagg
Copy link
Member Author

rvagg commented Mar 11, 2024

Added changelog docs about this. Also tested it out. Nothing in my systemd journal if I have none of the options set. If I set some of them then I get:

Mar 11 13:15:35 fletcher lotus-calibnet[2677403]: WARNING: Use of deprecated configuration option 'Fevm.Events.DisableRealTimeFilterAPI' will be removed in a future release, use 'Events.DisableRealTimeFilterAPI' instead
Mar 11 13:15:35 fletcher lotus-calibnet[2677403]: WARNING: Use of deprecated configuration option 'Fevm.Events.DisableHistoricFilterAPI' will be removed in a future release, use 'Events.DisableHistoricFilterAPI' instead
Mar 11 13:15:35 fletcher lotus-calibnet[2677403]: WARNING: Use of deprecated configuration option 'Fevm.Events.FilterTTL' will be removed in a future release, use 'Events.FilterTTL' instead
Mar 11 13:15:35 fletcher lotus-calibnet[2677403]: WARNING: Use of deprecated configuration option 'Fevm.Events.MaxFilters' will be removed in a future release, use 'Events.MaxFilters' instead
Mar 11 13:15:35 fletcher lotus-calibnet[2677403]: WARNING: Use of deprecated configuration option 'Fevm.Events.MaxFilterResults' will be removed in a future release, use 'Events.MaxFilterResults' instead
Mar 11 13:15:35 fletcher lotus-calibnet[2677403]: WARNING: Use of deprecated configuration option 'Fevm.Events.MaxFilterHeightRange' will be removed in a future release, use 'Events.MaxFilterHeightRange' instead

If I set Fevm.Events.DisableRealTimeFilterAPI to true then my eth_getLogs stops working:

$ curl -s -X POST   -H "Content-Type: application/json"   --data '{"method":"Filecoin.EthGetLogs", "params": [{}],"id":1,"jsonrpc":"2.0"}' http://localhost:1235/rpc/v1
{"jsonrpc":"2.0","id":1,"error":{"code":1,"message":"method not supported"}}

If I move that to Events.DisableRealTimeFilterAPI then it still doesn't work.

If I set Fevm.Events.DisableRealTimeFilterAPI to false and Events.DisableRealTimeFilterAPI to true then it works. As expected.

@rvagg rvagg merged commit e5ccf19 into release/v1.26.0 Mar 11, 2024
90 of 91 checks passed
@rvagg rvagg deleted the rvagg/move-events-cfg branch March 11, 2024 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants