Skip to content

Compare solochain to main#9

Draft
ffarall wants to merge 52 commits intomainfrom
solochain
Draft

Compare solochain to main#9
ffarall wants to merge 52 commits intomainfrom
solochain

Conversation

@ffarall
Copy link
Copy Markdown
Collaborator

@ffarall ffarall commented Apr 21, 2025

No description provided.

vgeddes and others added 30 commits January 30, 2025 14:45
* v2 initial commit

* latest changes

* Flesh out dispatch logic for inbound messages

* Add reward address

* make code compile

* Split initializer impl into a library to reduce contract size

* Major refactor

* Update tests

* add scripts back

* Update scripts

* Finish outbound messaging

* Implement token registration for V2

* Make functions payable

* improve docs

* comments

* review feedback

* cleanups

* Add initial tests for V2

* Make `rewardAddress` an indexed event parameter

* Clean up interfaces

* Make WETH address configurable

* Autowrap ether

* auto-unwrap ether

* Add view keyword

* off-chain part

* off-chain changes

* improve

* improve

* allow unlocking native ether

* improve token registration flows

* improve docs

* improve

* improve

* nit

* Update contracts/src/v1/Calls.sol

Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>

* Apply suggestions from code review

Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>

* Fix unlock WETH

* Suppress Error (6243): The "tload" instruction

* Merge recent changes

* add foundry setting

* relayer progress

* fixes

* adds xcm

* register token v2

* clean up register token smoketest

* fmt

* merge damage

* fix tests

* send token and relayer fixes

* relayer cleanup and transact

* send token to penpal smoke test

* syntax error

* adds penpal test to ci

* merge damage fixes

---------

Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
Co-authored-by: ron <yrong1997@gmail.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
* v2 initial commit

* latest changes

* Flesh out dispatch logic for inbound messages

* Add reward address

* make code compile

* Split initializer impl into a library to reduce contract size

* Major refactor

* Update tests

* add scripts back

* Update scripts

* Finish outbound messaging

* Implement token registration for V2

* Make functions payable

* improve docs

* Parachain relayer V2

* Rename to PendingOrder

* Decode compact int

* comments

* Improve doc

* review feedback

* cleanups

* Add initial tests for V2

* Make `rewardAddress` an indexed event parameter

* Remove unused

* Submit delivery proof

* Rename to InboundMessageV2

* Mark as view function

* Filter with reward address

* Clean up interfaces

* Make WETH address configurable

* Autowrap ether

* V2 smoke tests (Snowfork#1327)

* Update contracts for smoke tests

* Remove unused

* Decode test

* Update subxt

* Register PNA with OutbountQueueV2

* Fix storage key

* Comment out config

* Revert contract changes

* Fix function

* Regenerate binds & update package path

* Format

* Format

* Add todo

* Update bindings

* Update script

* auto-unwrap ether

* Update smoke tests

* Add view keyword

* More refactoring

* Verify V2 digest for commitment

* Call Contract with value

* improve

* improve

* allow unlocking native ether

* improve token registration flows

* improve docs

* improve

* improve

* nit

* Fix smoke test for V2

* Fix test

* Fix unlock WETH

* Sync with contract

* Fix smoke test

* Update contracts/src/v1/Calls.sol

Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>

* Apply suggestions from code review

Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>

* Fix unlock WETH

* Suppress Error (6243): The "tload" instruction

* Merge recent changes

* Fix breaking tests

* Fix tests

* Filter order by rewardAddress to handle own delivery proof

* Fix test

* Add ofac check

---------

Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
* Fix smoke tests

* Add smoke tests

* Prefund transfer ENA
* Create agent on Ethereum

* Add test

* Fix forge test

* Revamp smoke test

* Update go bindings

* Add register relay token back

* Fix transfer pna

* Remove obsolete code

* Update contracts/src/v2/Types.sol

Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>

* Update foundry.toml

* Rename follow the naming scheme

* Fix smoke test

* Fix function name

---------

Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
* Rather build register token on BH

* Add comments

* adds metadata fields to register token

* Revert "adds metadata fields to register token"

This reverts commit 90cbff5.

* update tests

* Cleanup

* Update bindings

* remove kusama as supported network

---------

Co-authored-by: claravanstaden <claravanstaden64@gmail.com>
Co-authored-by: ron <yrong1997@gmail.com>
* Rather build register token on BH

* Add comments

* adds metadata fields to register token

* Revert "adds metadata fields to register token"

This reverts commit 90cbff5.

* update tests

* Cleanup

* Update bindings

* Fix smoke test send token to destination chain

* Rename path

* Add send pna

* Check amount

---------

Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
Co-authored-by: claravanstaden <claravanstaden64@gmail.com>
* Log topic on ethereum side

* Fix test

* Update relayer

---------

Co-authored-by: ron <yrong1997@gmail.com>
* Add support for ether (Snowfork#1409)

* Upgrade gateway on Sepolia for westend (Snowfork#1407)

* Log gateway codehash

* Upgrade Gateway on Westend-Sepolia

* Update indexer endpoint & Cleanup (Snowfork#1411)

* Ban lido token (Snowfork#1412)

* Fix hardcoded url (Snowfork#1414)

* Register Polkadot Native Assets in Control Tool (Snowfork#1405)

* added function to register tokens

* fmt

* fix build errors

* clean up

* more assets

* fix message

* more tokens

* Update control/preimage/src/commands.rs

---------

Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>

* Force rebuild (Snowfork#1418)

* Update with V1 bindings

* Remove channel config

* Remove channel

* Remove topic id from InboundMessageDispatched

* Format codes (Snowfork#1416)

* Generate delivery receipt

* Revert "Remove topic id from InboundMessageDispatched"

This reverts commit 7e77f49.

	modified:   smoketest/src/helper.rs
	modified:   web/packages/test/scripts/build-binary.sh

* Fix script

* Clean up unused code

* Cleanup

* Minor fix

* Fix binding

* Change storage location

* Fix template

---------

Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
…nsaction (#4)

* feat: ✨ Add `BeefyVerification` and `ParachainVerification`

* feat: ✨ Use separated proofs in Gateway V2

* chore: 🏷️ Update bindings with new changes in Gatway V2

* fix: 🚨 Apply changes to relayer in Go with new GatewayV2 modifications

* revert: 🔥 Remove wrongly added worktree file
ffarall and others added 15 commits April 21, 2025 16:24
* init

* ci

* enable ci

* enable ci

* enable ci

* ci fix

* docker change

* docker fix

* typo

* push docker

* golang caching

* changes

* fix image name

* fix
* chore: ⬆️ Replace snowfork deps for our fork

* feat: ✨ Receive two ecdsa keys at startup

* feat: ✨ Adapt to new forked keypair package

* test: ✅ Use ecsa in connection test

* feat: 🚧 Make parachain's `ResolvePrivateKey` return an abstracted keypair, but use ecdsa in our case

* fix: 🚨 Make beacon and execution relays use the abstracted keypair type

* fix: 🚨 Remove unnecessary nil checks

* build: ⬇️ Update forked dependency tag

* fix: 🩹 Properly convert bytes to a hex string

* build: ⬆️ Upgrade fork dependency to fix test

* fix: 🐛 Use eth address instead of public key to fetch account info

* chore: 🏗️ Update encodings autogenerated

* fix: 🚨 Fix warning of unnecessary nil check

* feat: ✨ Use new Eth functionality

* chore: 👷 Run `go mod tidy`

* build: 👷 Fix label in dep
This PR refactors the existing `parachain` relayer to make it a
`solochain` relayer, stripping it from everything related to Parachains,
Para IDs and the notion of a Relaychain (except naming-wise, since we
want to keep changes compared to upstream at a minimum). As such:
- The `parachain` relayer is now launched with the `solochain` flag
instead, for clarity.
- The parachain heads root field from the BEEFY leafs has been renamed
to BeefyExtraField, to make it more generic.
- The mechanism to generate parachain heads proof has been changed to
generate message commitment roots.
- Logs in general have been improved, with extra debug logs and improved
clarity of info/warn/error logs, to make it easier for relayer operators
to know what's happening under the hood (and easier for us to debug it).
- Comments have been added to a few key functions so it's easier to
understand what they do.
This small PR updates the name of the relayer docker image published on
DockerHub to keep it in line with the naming convention upstream
Our `OutboundQueueV2` pallet was renamed in our runtime to
`EthereumOutboundQueueV2` so the solochain relayer wasn't able to find
the required storage items (since it was using the wrong storage key).
This PR fixes that
This PR updates the platform used when building the relayer image with
Docker to match what's expected on DataHaven (`linux/amd64`).
## Summary

This PR merges **117 commits** from `upstream/main`
(Snowfork/snowbridge) into the `solochain` branch, bringing in all
upstream improvements while preserving solochain-specific functionality.

- **Merge base**: `f53df1f9` - Fix Mythos hanging Txs (Snowfork#1476)
- **Commits merged**: 117
- **Conflicts resolved**: 15
- **Skipped (empty)**: 2

### Key Upstream Features Merged
- Snowbridge V2 contracts and API updates
- Profit estimation for relayers
- Gas estimator for Ethereum→Polkadot
- Beefy client v2 and pipeline improvements
- OFAC checks v2
- Delivery-reward relay separation
- Multiple SDK improvements (Register Tokens, Register Agent, Custom
XCM)
- Fulu hard fork support

### Solochain-Specific Resolutions

| Commit | Description | Resolution |
|--------|-------------|------------|
| d836eb3 | Fix smoke tests | Kept solochain gateway.go |
| 876eed0 | On-demand Beefy | Kept solochain scanner.go |
| 16d3359 | Backport changes | Kept solochain main.go, updated
heartbeat API |
| bac8c95 | Profit Estimation | Integrated with solochain naming |
| 07e0ae3 | Limit calldata | Kept both `_verifyBeefyProof` and
`transactionBaseGas` |
| 1b27a2c | V2 API | Kept solochain BeefyClient ABI (beefyExtraField) |
| daaab80 | CLI command | Integrated private key file/ID for solochain
|
| d710cd3 | Proof generation | Implemented two-tier fallback (chain
storage → off-chain) |
| a684acc | Delivery-reward relay | Kept solochain components
(solochainWriter, beaconHeader, etc.) |

### Proof Generation Strategy (Commit 98)

For solochain, we implemented a **two-tier fallback approach**:

1. **PRIMARY**: Fetch proofs from chain storage via
`scanForOutboundQueueProofs()`
2. **FALLBACK**: Compute proofs off-chain via
`buildOutboundQueueProofs()`

This differs from upstream parachain which only uses off-chain
computation.

### Build Fixes Applied

After merging, the following build fixes were required:
- Added Moonsong-Labs go-substrate-rpc-client fork (BeefyExtraField
support)
- Added missing imports in parachain relay config and main
- Added `HeartbeatSecs` to SolochainConfig
- Added `PendingOrder` type for message tracking
- Fixed `Message.OriginalMessage.Nonce` reference
- Fixed `Payload.Message` vs `Payload.Xcm` field names
- Fixed keypair type conversions for sr25519

## Documentation

See [MERGE_PROGRESS.md](./MERGE_PROGRESS.md) for detailed
commit-by-commit tracking.

## Test Plan

- [x] Relayer builds successfully (`go build`)
- [ ] Run relayer integration tests
- [x] Test beacon relay checkpoint generation
- [ ] Test beefy relay with solochain
- [ ] Test message transfers (both directions)

---------

Signed-off-by: friendlyping <friendlyping@icloud.com>
Signed-off-by: houpo-bob <houpocun@outlook.com>
Signed-off-by: wmypku <wmypku@outlook.com>
Signed-off-by: juejinyuxitu <juejinyuxitu@outlook.com>
Signed-off-by: suranmiao <solsui@outlook.com>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Clara van Staden <clara@snowfork.com>
Co-authored-by: friendlyping <friendlyping@icloud.com>
Co-authored-by: houpo-bob <houpocun@outlook.com>
Co-authored-by: Alistair Singh <alistair@snowfork.com>
Co-authored-by: wmypku <wmypku@outlook.com>
Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>
Co-authored-by: Ocheretovich <ocheretovich@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
Co-authored-by: juejinyuxitu <juejinyuxitu@outlook.com>
Co-authored-by: suranmiao <solsui@outlook.com>
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
- Install `ca-certificates` package in the relay Docker image to enable
TLS connections to secure `wss://` endpoints
- Without CA certificates, the relay fails to connect with `x509:
certificate signed by unknown authority` errors

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants