# Week 17 Update
This week since my mentor was OOO , i could not get much further review on my pr , but I
- Fixed the refactors that were asked for the era pr
- Added the sync integration for ERA production in Lodestar
-
**Lodestar can now produce ERA files directly from DB 🎉 by syncing**.
Lodestar uses Level-DB as their choice of Database and
we are using `db.stateArchive` and `db.blockArchive ` bucket for our era imports.
`stateArchive` happens every 1024 epochs and `blockArchive` happens every block, so for testing purposed I had to decrease the frequency of state Archieve by adding the ` --chain.archiveStateEpochFrequency ` to the CI to 256.
This piece of code sums up exporting ERA files from db and this articulates how we both need stateArchive and blockArchive buckets for ERA export.
```typescript
export async function exportEraFromDb(options: EraExportOptions) {
const state = await db.stateArchive.get(stateSlot); // Read from DB
const block = await db.blockArchive.get(slot); // Read from DB
// Convert to SSZ bytes
const stateSSZ = state.serialize();
const blockSSZ = config.getForkTypes(slot).SignedBeaconBlock.serialize(block);
// delegate ERA building here
return writeEraGroup({...});
}
```
## SSZ-ZIG Stuff ⚡️
I [finished adding](https://github.com/ChainSafe/ssz-z/pull/64) Compatible Union to the ssz-z library .
**This concludes all the Progressive SSZ types being implemented in the ssz-z library 🎉**.
The spec tests for all Progressive Types pass and the pr will be ci/cd ready when the new spec test will be released .
### What are Compatible Union Anyways?
It’s a union type in SSZ that ensures that all variants point to the same structure aka stable “gindex” assignments in merkle trees so that we can work with multiple versions or versions with optional fields.
In Compatible Union, a variant shares an identical SSZ Merkle tree structure and then we encode a 1-byte selector to indicate which variant is active. During hashing, the selector is mixed into the variant’s root hash, ensuring that all variants remain compatible .