The serialization spec defines:
def is_active_field(element):
return not is_optional(element) or element is not None
In the specification of StableContainer[N]
it’s stated that:
" All fields of a StableContainer[N]
MUST be of of type Optional[T]
. Such fields can either represent a present value of SSZ type T
, or indicate absence of a value (indicated by None
). The default valueof an Optional[T]
is None
."
This makes the first part of is_active_field
seem ambiguous - what does is_optional
mean? If it means “of type Optional[T]
”, this is true for all fields by definition, so do we actually want this?
def is_active_field(element):
return element is not None