# EOF header access in Verkle ###### tags: `EOF`, `verkle` ## Header size bounds Reference calculation in evmone implementation: https://github.com/ethereum/evmone/blob/21d783913a8dafd4300ee13cf55077de4f12983c/lib/evmone/eof.cpp#L44 ### Non-factory contracts Regular contracts not containing `EOFCREATE` instruction. header_size = 13 + 2 * num_code_sections Min header size = 15 byte Max header size (1024 code sections) = 2061 byte ### Factory contracts Contracts containing `EOFCREATE` instruction. They have additional container sections, therefore header is larger. header_size = 16 + 2 * num_code_sections + 2 * num_container_sections Min header size = 20 byte Max header size (1024 code section, 256 container sections) = 2576 byte Realistically most factory contracts would need just one or a couple of container sections. ### Type section Type section is technically not part of the header, but can be seen as another part of contract metadata. It is required only when executing `CALLF` or `JUMPF` instructions (i.e. calling into other code sections). In the container it directly follows the header. It can be randomly accessed, so optimized `CALLF`/`JUMPF` implementation could read only its target's section type without reading entire type section. type_section_size = 4 * num_code_sections Min type section size = 4 bytes Max header size (1024 code sections) = 4096 byte