Optimistic Locking clarification?

It just gets the field from the changeset source:

https://github.com/elixir-ecto/ecto/blob/4a143348ab89e0174a1a5082fd47d868ebd9689b/lib/ecto/changeset.ex#L3418

You don’t need to cast just to access the source data. And you don’t want to cast the lock version, because you don’t want the value to be set from the parameters.