Skip to content

Conversation

@dmarzzz
Copy link
Member

@dmarzzz dmarzzz commented Jun 9, 2025

📝 Summary

Implements dynamic SSZ encoding support to enable MEV-Boost relay compatibility with Ethereum minimal spec devnets, while maintaining full backward compatibility with mainnet/testnet operations.
Key Changes:

  • Added dependency: github.com/pk910/dynamic-ssz v0.0.4
  • New SSZManager: Thread-safe manager with automatic spec detection and graceful fallbacks
  • Enhanced beacon client: New GetSpecRaw() method captures complete beacon spec configuration
  • Updated function signatures: BuildGetHeaderResponse() now accepts SSZManager parameter

⚠️ Warning: Majority of this code was vibe coded with human steering in the loop. ⚠️

⛱ Motivation and Context

Faster iterative testing on devnets

📚 References

#738


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@dmarzzz dmarzzz marked this pull request as ready for review June 9, 2025 13:08
@dmarzzz dmarzzz changed the title vibe code the minimal spec Minimal Spec Support Jun 9, 2025
@metachris
Copy link
Collaborator

Interesting, thanks for opening the PR! 🔥


func (r *VersionedSubmitBlockRequest) HashTreeRootWithManager(sszManager *SSZManager) (phase0.Root, error) {
if sszManager != nil && sszManager.IsInitialized() {
return sszManager.HashTreeRoot(r)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need the same switch/case logic as below.
you'll need to pass r.Capella / r.Deneb or r.Electra to sszManager.HashTreeRoot.
passing the whole versioned object will give you an invalid tree root (most likely throws an error too, as nil pointers are not allowed in ssz)

specConfig := make(map[string]interface{})

// Add relevant fields from beacon spec
specConfig["SECONDS_PER_SLOT"] = strconv.FormatUint(beaconSpec.SecondsPerSlot, 10)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this mapping really necessary?
Ideally you'll pass all spec values to dynssz, as it's not obvious if you mapped all the required spec values here.

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.

3 participants