<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_virtualchain_field(cls, opdata, virtualchain_field, value):
 """ Set a virtualchain field value. Used by implementations that generate extra consensus data at the end of a block """

        assert virtualchain_field in RESERVED_KEYS, 'Invalid field name {} (choose from {})'.format(virtualchain_field, ','.join(RESERVED_KEYS))
        opdata[virtualchain_field] = value