datahaven/test/scripts
Gonza Montiel 733218ac79
fix: 🛡️ Check origin for validator set messages (#343)
### Context
The function `v2_sendMessage()` on Snowbridge Gateway contract is
**permissionless** (I'm shocked this is the design choice). Any
EOA/contract on Ethereum can build a message and send it through our DH
bridge. While we don't change our Snowbridge fork, then this will
continue to be the case.

### Problem
We use `v2_sendMessage()` to send **permissioned** operations to our
chain. For instance: update our validator set message (coming next,
_slashing-related_ messages). So we do need to restrict the processing
of the incoming messages on the Substrate side.

### Fix
- I've added a check to `EigenLayerMessageProcessor` that enforces
`message.origin` to be only a configured `AuthorisedOrigin`.
- I've added an `AuthorisedOrigin` to
`pallet_external_validators::Config`
- I've configured the `AuthorisedOrigin` to be
`DatahavenServiceManagerAddress` in all three runtimes

### Stages
- [x] Implementation
- [x] Runtime integration tests
- [x] Collect `DatahavenServiceManagerAddress` parameter for e2e tests
to work

Fixes https://github.com/datahaven-xyz/sr-datahaven/issues/12

---------

Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-12-15 14:11:08 +01:00
..
cargo-crossbuild.ts test: 🏗️ Setup e2e testing framework (#104) 2025-07-16 18:51:07 +02:00
compile-contracts.sh test: port Moonwall block validation suite (#201) 2025-10-06 09:47:35 +02:00
compile-contracts.ts test: port Moonwall block validation suite (#201) 2025-10-06 09:47:35 +02:00
deploy-contracts.ts fix: 🛡️ Check origin for validator set messages (#343) 2025-12-15 14:11:08 +01:00
fund-providers.ts feat: 🚀 add storage-hub nodes to CLI (#287) 2025-11-22 11:49:14 +01:00
fund-validators.ts fix: build contracts with test/mocks (#317) 2025-11-24 17:36:29 +01:00
register-providers.ts feat: 🚀 add storage-hub nodes to CLI (#287) 2025-11-22 11:49:14 +01:00
send-txn.ts fix: 🚨 Add error in TS for missing awaits (#81) 2025-05-19 22:28:43 +00:00
set-datahaven-parameters.ts feat: 🚀 Add deploy command to CLI (#87) 2025-06-12 10:24:03 +02:00
setup-validators.ts test: Update validator set e2e test (#126) 2025-10-02 11:23:40 +00:00
test-parallel.ts test: port ethereum tests from moonbeam (#278) 2025-11-22 10:02:05 +01:00
update-validator-set.ts test: 🏗️ Setup e2e testing framework (#104) 2025-07-16 18:51:07 +02:00