Skip to content

Prune unused imports before rendering files - #21

Merged
syjn99 merged 1 commit into
OffchainLabs:mainfrom
syjn99:feat/emit-unused-imports
Oct 26, 2026
Merged

syjn99 merged 1 commit into
OffchainLabs:mainfrom
syjn99:feat/emit-unused-imports

Conversation

@syjn99

@syjn99 syjn99 commented Aug 31, 2026

Copy link
Copy Markdown
Member
var DefaultSSZImports = map[string]string{
	"github.com/OffchainLabs/methodical-ssz/ssz": "ssz",
	"fmt":             "",
	"encoding/binary": "binary", // explicit alias kept only for golden-test stability
}

DefaultSSZImports asserts that encoding/binary is always used, but it's not true when there's no integer fields for SSZ objects. While working on SSZ Engine, newly defined SSZ objects don't have an integer field at all, making compile error when the files are generated using methodical.

Instead of pruning the unused one in downstream (which is Prysm), I'd rather submitted a change for methodical which is this PR. This PR prunes the entries of imports when they aren't referenced.

@syjn99

syjn99 commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

@prestonvanloon

It would be nice if we can include this after #22 got merged.

@syjn99
syjn99 force-pushed the feat/emit-unused-imports branch from 5c39216 to b7fcc87 Compare October 26, 2026 09:09
@syjn99
syjn99 changed the base branch from progression to main October 26, 2026 09:09
@syjn99
syjn99 force-pushed the feat/emit-unused-imports branch from b7fcc87 to fa7f39a Compare October 26, 2026 09:12
@syjn99

syjn99 commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

Force-pushed because the base branch (progression) is now included in main by #22. No content changes for this PR. Now merging it.

@syjn99
syjn99 merged commit c3f77ce into OffchainLabs:main Oct 26, 2026
3 checks passed
@syjn99
syjn99 deleted the feat/emit-unused-imports branch October 26, 2026 09:14
syjn99 added a commit to syjn99/prysm that referenced this pull request Oct 29, 2026
**What does this PR do? Why is it needed?**

This PR updates `methodical-ssz` version to
[`c3f77ce44447`](https://github.com/OffchainLabs/methodical-ssz/tree/c3f77ce4444791c8d75cb950c8324f482ebebbed)
which includes these three PRs:

- OffchainLabs/methodical-ssz#22: Mostly worked
by Kasey on Progression merkleization support. This version is already
used in our production path (`932cc738`).
- OffchainLabs/methodical-ssz#23: Needed for
EIP-8015 and Decoupled consensus work. This fixes an issue when we have
"inactive" fields in the progressive container.
- OffchainLabs/methodical-ssz#21: Unlocks SSZ
Engine work.

**Which issue does this PR fix?**

N/A

**Other notes for review**

The diff in this PR, except dependency changes, is ALL comment changes.
Now generated codes for computing HTR of the progressive container
denote `Field` to `Position` which is much more accurate. No functional
changes intended as there is no "inactive" fields in Fulu/Gloas.

**Acknowledgement**

- [x] I have read
[CONTRIBUTING.md](https://github.com/OffchainLabs/prysm/blob/develop/CONTRIBUTING.md)
and my PR follows its checklist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants