datahaven/operator
Gonza Montiel e9fc4f271f
Fix: 🏗️ Message encoding / decoding (#113)
## Summary of changes
- We decided to remove the topics and nonce from the massage encoding
since we don't use them (original commit:
ee2a3f2fd4).
- Besides, we already have a nonce at the Snowbridge message level
f4ab5c2b2e/operator/primitives/snowbridge/inbound-queue/src/v2/message.rs (L105)

- I had to recreate the static test for _encoding_ (happens in
[DataHavenSnowbridgeMessages.sol](d12d40634f/contracts/src/libraries/DataHavenSnowbridgeMessages.sol)
) / _decoding_ (happens in
[operator/primitives/bridge/src/lib.rs)](f9f9cc65fe/operator/primitives/bridge/src/lib.rs).
Now it matches the current structure. The idea is that now we can test
that we don't break the decoding in followup refactoring.
- Fixes a problem with EigenLayer validator addresses. In all our
contracts we were using `bytes32` to refer to a Solochain validator
address. But on our Substrate change we actually expect AccountId20, so
only 20 bytes. This was causing the decoding to fail.
- I opted for the minimal change that would be to take the right-most 20
bytes to send that to our chain. But we might want aswell to limit our
EigenLayer contracts to be only 20 bytes long. @ahmadkaouk showcase this
[here](92a34c273c)
- Adds a bash script to run the static test. The test will compile the
contracts, run the encoding test, compile the operator, and run the
decoding test. This saves a huge amount of time since we don't need to
run the full e2e setup. The way of running it is the following:
```bash
cd operator/test/scripts
./test_message_encoding.sh
```
- As a consequence of this PR, the execution relayer now works properly.

EDIT:

> [!IMPORTANT]
**We decided to use 20-byte addresses in our contracts**. So what is
stated above is not valid anymore.

The change implies that the mapping from Ethereum addresses to bytes32
addresses now it's a mapping as follows:


dd3ba99ac0/contracts/src/DataHavenServiceManager.sol (L51-L52)

I've updated helper functions, tests, etc to be compliant with this
change. The execution relayer and beefy relayer look stable now.

---------

Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-07-16 07:38:58 +00:00
..
.cargo refactor: 🐳 Improve docker caching (again) (#86) 2025-05-27 16:14:15 +00:00
node feat: add storage hub runtime (#40) 2025-07-01 14:01:27 +02:00
pallets feat: Native Token Transfer to Ethereum (#88) 2025-06-12 00:07:36 +02:00
primitives Fix: 🏗️ Message encoding / decoding (#113) 2025-07-16 07:38:58 +00:00
runtime Fix: 🏗️ Message encoding / decoding (#113) 2025-07-16 07:38:58 +00:00
scripts feat(ci): add script to sort cargo deps (#62) 2025-05-06 17:22:01 +00:00
test Fix: 🏗️ Message encoding / decoding (#113) 2025-07-16 07:38:58 +00:00
.dockerignore refactor: 🐳 Improve docker caching (again) (#86) 2025-05-27 16:14:15 +00:00
.gitignore build: 🏗️ DataHaven operator setup (#6) 2025-03-17 17:57:14 +01:00
Cargo.lock feat: Add native token transfer support from Ethereum to DataHaven (#97) 2025-07-03 14:41:51 +00:00
Cargo.toml feat: add storage hub runtime (#40) 2025-07-01 14:01:27 +02:00
Dockerfile refactor: 🐳 Improve docker caching (again) (#86) 2025-05-27 16:14:15 +00:00
LICENSE build: 🏗️ DataHaven operator setup (#6) 2025-03-17 17:57:14 +01:00
README.md fix: 🩹 update to allow BEEFY relayer to run correctly (#67) 2025-05-16 01:56:19 +00:00
rust-toolchain.toml test: New CLI functions (#84) 2025-05-22 20:02:12 +00:00

DataHaven 🫎

Based on polkadot-sdk-solochain-template

Zombienet testing

First, install zombienet.

To spawn a local solo chain with four validators and BABE finality, run:

zombienet -p native spawn test/config/zombie-datahaven-local.toml