Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9966daa
surface substrate transfers and swaps as evm logs
mrq1911 May 1, 2026
e781d15
forked balances & tokens pallet
mrq1911 May 4, 2026
b115483
integration test prep
mrq1911 May 4, 2026
f296eef
Merge branch 'synth-evm-logs-pallets' into synth-evm-logs
mrq1911 May 4, 2026
3f9e91b
hooks
mrq1911 May 4, 2026
7939302
Merge branch 'master' into synth-evm-logs
mrq1911 May 4, 2026
a38f0cb
correctly ordering logs
mrq1911 May 4, 2026
0d0d569
reserve support
mrq1911 May 4, 2026
a60e451
fmt
mrq1911 May 4, 2026
503a973
fees and slashing support
mrq1911 May 4, 2026
18ad577
check for reverts
mrq1911 May 4, 2026
eb54ced
approval logs
mrq1911 May 4, 2026
6c08e09
reverting dispatcher
mrq1911 May 4, 2026
4d9bc93
hook phases consideration
mrq1911 May 4, 2026
b3bf322
fixed tx hash indexing
mrq1911 May 4, 2026
abb4c2e
lessblabla
mrq1911 May 5, 2026
1a9dd18
clippy
mrq1911 May 5, 2026
a10fefa
bumps
mrq1911 May 5, 2026
01c2fe5
fmt
mrq1911 May 5, 2026
0fe414b
Merge branch 'master' into synth-evm-logs
mrq1911 May 5, 2026
5169b5a
domain-separate synth tx hash per block
mrq1911 May 29, 2026
23ad622
O(1) buffer push, n log n flush
mrq1911 May 29, 2026
38dc4e5
extract pure evm-log builders
mrq1911 May 29, 2026
3624320
event-reader for transfers and swapped3
mrq1911 May 29, 2026
a5040da
pure shared assemble_synth_txs
mrq1911 May 29, 2026
b7b75c7
SyntheticEthLogsApi runtime api
mrq1911 May 29, 2026
8fcf853
A/B parity test: api equals flusher
mrq1911 May 29, 2026
f0d8e4d
SyntheticStorageOverride for eth-rpc
mrq1911 May 29, 2026
701e948
vendored mapping-sync indexes synth tx hashes
mrq1911 May 30, 2026
c67eb7d
cut over to node-only synth logs
mrq1911 May 30, 2026
5c6c6e1
pure shared event->synth-tx translation
mrq1911 May 30, 2026
444cccf
translate synth logs client-side from state
mrq1911 May 30, 2026
62aac1c
Merge remote-tracking branch 'origin/master' into feat/synth-logs-nod…
mrq1911 May 30, 2026
57d30fc
defer to on-chain synth txs for legacy blocks
mrq1911 May 30, 2026
0b029b3
map full balance movements off-chain
mrq1911 May 30, 2026
77a047d
per-log evm dedup; native slash to reserved
mrq1911 May 30, 2026
7f84774
include synth txs in current_block
mrq1911 May 30, 2026
ac0a8fb
drop dead evm-frame-logs seam
mrq1911 Jun 2, 2026
6987314
drop fork-only hook members from mocks
mrq1911 Jun 2, 2026
7c87696
trim verbose comments
mrq1911 Jun 2, 2026
0d85ab0
canonical block hashes via custom eth_getLogs filter
mrq1911 Jun 2, 2026
d1532d9
bump runtime-integration-tests
mrq1911 Jun 2, 2026
1576ad8
Merge remote-tracking branch 'origin/master' into feat/synth-logs-nod…
mrq1911 Jun 3, 2026
989fe29
revert stray pallet version bumps
mrq1911 Jun 3, 2026
fceb6eb
fold synthetic-logs crate into runtime
mrq1911 Jun 3, 2026
35a92bd
drop dead evm runner/precompile churn
mrq1911 Jun 3, 2026
fa042a5
inline synthetic-logs tests
mrq1911 Jun 3, 2026
9b24cbc
group node synthetic-logs module
mrq1911 Jun 3, 2026
9c4da72
drop dead SyntheticEthLogsApi runtime api
mrq1911 Jun 3, 2026
37a0b63
appease clippy in eth_filter
mrq1911 Jun 3, 2026
d1d7aa5
add from-source builder dockerfiles
mrq1911 Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
target/
!target/release/hydradx
Dockerfile
.git
**/node_modules
launch-configs/fork/data
launch-configs/fork/state.json
launch-configs/fork/forked-chainspec.json
14 changes: 11 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Dockerfile.with-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Self-contained build of the synth-logs node: compiles from source in a builder
# stage, then ships just the binary. Builder and runtime share glibc (bookworm
# 2.36), so no host/base libc mismatch.
FROM rust:1.88-bookworm AS builder

RUN apt-get update && apt-get install -y --no-install-recommends \
clang protobuf-compiler cmake pkg-config libssl-dev git \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /build
COPY . .

ENV CXXFLAGS="-include cstdint"
RUN cargo build --release --locked --config net.git-fetch-with-cli=true -p hydradx

FROM debian:bookworm-slim
LABEL org.opencontainers.image.source = "https://github.com/galacticcouncil/hydration-node"

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 -U -s /bin/sh -d /hydra hydra && \
mkdir -p /hydra/.local/share && \
chown -R hydra:hydra /hydra

COPY --from=builder /build/target/release/hydradx /usr/local/bin/hydradx

USER hydra
EXPOSE 30333 9933 9944 9615
VOLUME ["/hydra/.local/share"]

ENTRYPOINT ["/usr/local/bin/hydradx"]
CMD ["--prometheus-external", "--", "--execution=wasm" ,"--telemetry-url", "wss://telemetry.hydradx.io:9000/submit/ 0"]
3 changes: 2 additions & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.88.0"
version = "1.88.1"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand Down Expand Up @@ -51,6 +51,7 @@ pallet-gigahdx = { workspace = true }
pallet-gigahdx-rewards = { workspace = true }
liquidation-worker-support = { workspace = true }
pallet-broadcast = { workspace = true }
ethereum-types = { workspace = true }
pallet-duster = { workspace = true }
pallet-duster-rpc-runtime-api = { workspace = true }

Expand Down
10 changes: 3 additions & 7 deletions integration-tests/src/dca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3723,14 +3723,12 @@ mod stableswap {

assert_eq!(
alice_stable_shares_after, 0,
"User should have 0 pool shares since DCA execution failed. Got {}",
alice_stable_shares_after
"User should have 0 pool shares since DCA execution failed. Got {alice_stable_shares_after}"
);

assert_eq!(
router_reserved_shares, 0,
"Router should have 0 reserved shares. Got {}",
router_reserved_shares
"Router should have 0 reserved shares. Got {router_reserved_shares}"
);

TransactionOutcome::Commit(DispatchResult::Ok(()))
Expand Down Expand Up @@ -5556,9 +5554,7 @@ mod extra_gas_erc20 {

assert!(
fee_with_extra > base_fee,
"Fee with extra gas ({}) should be > base fee ({})",
fee_with_extra,
base_fee
"Fee with extra gas ({fee_with_extra}) should be > base fee ({base_fee})"
);

// The first attempt charged base fee (before extra gas was added)
Expand Down
13 changes: 4 additions & 9 deletions integration-tests/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn dispatch_as_aave_admin_can_modify_supply_cap_on_testnet() {
RuntimeEvent::Dispatcher(pallet_dispatcher::Event::AaveManagerCallDispatched {
result: Ok(..), ..
}) => {}
_ => panic!("Unexpected event: {:?}", event),
_ => panic!("Unexpected event: {event:?}"),
}
});
}
Expand Down Expand Up @@ -248,8 +248,7 @@ fn dispatch_with_extra_gas_should_pay_for_extra_gas_used_when_it_is_not_used() {
let gas_eater_paid_fee = initial_alice_hdx_balance - alice_balance_final;
assert_eq!(
gas_eater_paid_fee, hydra_paid_fee,
"GasEater transfer should cost the same as HydraToken transfer: {:?} == {:?}",
gas_eater_paid_fee, hydra_paid_fee
"GasEater transfer should cost the same as HydraToken transfer: {gas_eater_paid_fee:?} == {hydra_paid_fee:?}"
);
});
}
Expand Down Expand Up @@ -363,17 +362,13 @@ fn dispatch_with_extra_gas_should_not_refund_extra_gas_correctly() {
// Fee charged on tx submit should be higher in the second case
assert!(
fee_charge_2 > fee_charge_1,
"Fee charged on tx submit should be higher in the second case: {:?} > {:?}",
fee_charge_2,
fee_charge_1
"Fee charged on tx submit should be higher in the second case: {fee_charge_2:?} > {fee_charge_1:?}"
);

// the two tx fees should be the same because it should refund correctly the unused gas
assert!(
actual_fee_paid_1 < actual_fee_paid_2,
"Paid fee should be higher for the second tx: {:?} < {:?}",
actual_fee_paid_1,
actual_fee_paid_2
"Paid fee should be higher for the second tx: {actual_fee_paid_1:?} < {actual_fee_paid_2:?}"
);
}

Expand Down
18 changes: 6 additions & 12 deletions integration-tests/src/dynamic_fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@ fn fees_should_be_applied_correctly_when_min_equals_max_in_dynamic_config() {
println!("DOT asset fee: 1% (applied on DOT being sold)");
println!("HDX protocol fee: 0.5% (applied on HDX being received)");
println!("---");
println!("Amount received with zero fees: {}", amount_out_with_zero_fee);
println!("Amount received with fees: {}", amount_out_with_fee);
println!("Difference: {}", actual_difference);
println!("Actual percentage difference: {:.4}%", actual_percentage_value);
println!("Amount received with zero fees: {amount_out_with_zero_fee}");
println!("Amount received with fees: {amount_out_with_fee}");
println!("Difference: {actual_difference}");
println!("Actual percentage difference: {actual_percentage_value:.4}%");
println!("====================================\n");

// Verify the fees were applied (should see some difference)
Expand All @@ -850,16 +850,10 @@ fn fees_should_be_applied_correctly_when_min_equals_max_in_dynamic_config() {

assert!(
actual_percentage_value >= expected_percentage - tolerance,
"Actual fee percentage ({:.4}%) is lower than expected ({:.2}% - {:.2}%)",
actual_percentage_value,
expected_percentage,
tolerance
"Actual fee percentage ({actual_percentage_value:.4}%) is lower than expected ({expected_percentage:.2}% - {tolerance:.2}%)"
);
assert!(
actual_percentage_value <= expected_percentage + tolerance,
"Actual fee percentage ({:.4}%) is higher than expected ({:.2}% + {:.2}%)",
actual_percentage_value,
expected_percentage,
tolerance
"Actual fee percentage ({actual_percentage_value:.4}%) is higher than expected ({expected_percentage:.2}% + {tolerance:.2}%)"
);
}
15 changes: 7 additions & 8 deletions integration-tests/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ mod account_conversion {
ExitReason::Succeed(ExitSucceed::Stopped)
);

println!("{:?}", res);
println!("{res:?}");
});
}

Expand Down Expand Up @@ -3833,9 +3833,7 @@ fn compare_fee_in_eth_between_evm_and_native_omnipool_calls() {
let native_fee = new_alice_currency_balance - alice_currency_balance_pre_dispatch;
assert!(
evm_fee > native_fee,
"assertion failed evm_fee > native fee. Evm fee: {:?} Native fee: {:?}",
evm_fee,
native_fee
"assertion failed evm_fee > native fee. Evm fee: {evm_fee:?} Native fee: {native_fee:?}"
);

let fee_difference = evm_fee - native_fee;
Expand All @@ -3846,9 +3844,7 @@ fn compare_fee_in_eth_between_evm_and_native_omnipool_calls() {
// EVM fees should be not higher than 20%
assert!(
relative_fee_difference < tolerated_fee_difference,
"relative_fee_difference: {:?} is bigger than tolerated {:?}",
relative_fee_difference,
tolerated_fee_difference
"relative_fee_difference: {relative_fee_difference:?} is bigger than tolerated {tolerated_fee_difference:?}"
);
})
}
Expand Down Expand Up @@ -4850,7 +4846,10 @@ impl PrecompileHandle for MockHandle {
}

fn log(&mut self, _: H160, _: Vec<H256>, _: Vec<u8>) -> Result<(), ExitError> {
unimplemented!()
// no-op: tests using this mock handle don't inspect emitted logs;
// the precompile (e.g. multicurrency) calls `handle.log(...)` to emit
// the ERC-20 Transfer event inline, which we accept silently here.
Ok(())
}

fn code_address(&self) -> H160 {
Expand Down
10 changes: 3 additions & 7 deletions integration-tests/src/evm_permit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ fn compare_fee_in_hdx_between_evm_and_native_omnipool_calls_when_permit_is_dispa
// EVM fees should be not higher than 20%
assert!(
relative_fee_difference < tolerated_fee_difference,
"relative_fee_difference: {:?} is bigger than tolerated {:?}",
relative_fee_difference,
tolerated_fee_difference
"relative_fee_difference: {relative_fee_difference:?} is bigger than tolerated {tolerated_fee_difference:?}"
);
})
}
Expand Down Expand Up @@ -1195,13 +1193,11 @@ fn evm_permit_set_currency_dispatch_should_pay_evm_fee_in_insufficient_asset() {
let payed_fee = initial_user_insufficient_balance - user_insufficient_asset_balance;
assert!(
payed_fee > 50_000_000,
"payed_fee: {:?} is less than 50_000_000",
payed_fee
"payed_fee: {payed_fee:?} is less than 50_000_000"
);
assert!(
payed_fee < 120_000_000,
"payed_fee: {:?} is more than 120_000_000",
payed_fee
"payed_fee: {payed_fee:?} is more than 120_000_000"
);

TransactionOutcome::Commit(DispatchResult::Ok(()))
Expand Down
20 changes: 10 additions & 10 deletions integration-tests/src/global_withdraw_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn xcm_message_withdraw_deposit(token_location: Location, amount: Balance) -> Xc
Xcm(vec![
WithdrawAsset(asset.clone().into()),
BuyExecution {
fees: asset.into(),
fees: asset,
weight_limit: Unlimited,
},
DepositReserveAsset {
Expand All @@ -54,7 +54,7 @@ fn set_dot_external_and_get_transfer_call() -> hydradx_runtime::RuntimeCall {

let dot: Asset = Asset {
id: cumulus_primitives_core::AssetId(DOT_ASSET_LOCATION.into()),
fun: Fungible(1 * UNITS),
fun: Fungible(UNITS),
};

let bob_beneficiary = Location::new(
Expand Down Expand Up @@ -195,7 +195,7 @@ fn xtokens_transfer_should_fail_when_lockdown_active_and_asset_is_egress() {

let call = RuntimeCall::XTokens(orml_xtokens::Call::transfer {
currency_id: HDX,
amount: 1 * UNITS,
amount: UNITS,
dest: Box::new(bob_location.into_versioned()),
dest_weight_limit: WeightLimit::Unlimited,
});
Expand Down Expand Up @@ -238,7 +238,7 @@ fn on_charge_transaction_skips_global_withdraw_accounting_for_native_asset() {
let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![1, 2, 3] });

// Act
let fee_amount = 1 * UNITS;
let fee_amount = UNITS;
let _ = <hydradx_runtime::Runtime as pallet_transaction_payment::Config>::OnChargeTransaction::withdraw_fee(
&alice,
&call,
Expand All @@ -264,7 +264,7 @@ fn on_charge_transaction_skips_global_withdraw_accounting_for_native_asset() {
Currencies::withdraw(
HDX,
&BOB.into(),
1 * UNITS,
UNITS,
frame_support::traits::ExistenceRequirement::AllowDeath
),
pallet_circuit_breaker::Error::<hydradx_runtime::Runtime>::WithdrawLockdownActive
Expand Down Expand Up @@ -311,7 +311,7 @@ fn on_charge_transaction_skips_global_withdraw_accounting_for_external_asset() {
let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![1, 2, 3] });

// Act
let fee_amount = 1 * UNITS;
let fee_amount = UNITS;
let _ = <hydradx_runtime::Runtime as pallet_transaction_payment::Config>::OnChargeTransaction::withdraw_fee(
&alice,
&call,
Expand All @@ -337,7 +337,7 @@ fn on_charge_transaction_skips_global_withdraw_accounting_for_external_asset() {
Currencies::withdraw(
DOT,
&ALICE.into(),
1 * UNITS,
UNITS,
frame_support::traits::ExistenceRequirement::AllowDeath
),
pallet_circuit_breaker::Error::<hydradx_runtime::Runtime>::WithdrawLockdownActive
Expand Down Expand Up @@ -407,7 +407,7 @@ fn evm_on_charge_transaction_skips_global_withdraw_accounting() {
Currencies::withdraw(
WETH,
&evm_account,
1 * UNITS,
UNITS,
frame_support::traits::ExistenceRequirement::AllowDeath
),
pallet_circuit_breaker::Error::<hydradx_runtime::Runtime>::WithdrawLockdownActive
Expand Down Expand Up @@ -804,7 +804,7 @@ fn dot_external_limit_trigger_fails_then_decays_to_zero() {
assert_ok!(AssetRegistry::set_location(DOT, DOT_ASSET_LOCATION));

let alice: AccountId = ALICE.into();
let amount = 1 * UNITS;
let amount = UNITS;
assert!(
Currencies::free_balance(DOT, &alice) >= amount * 3,
"Test requires Alice to have enough DOT"
Expand Down Expand Up @@ -877,7 +877,7 @@ fn dot_external_lockdown_blocks_withdraw_but_regular_dot_transfer_still_works()

let alice: AccountId = ALICE.into();
let bob: AccountId = BOB.into();
let amount = 1 * UNITS;
let amount = UNITS;
assert!(Currencies::free_balance(DOT, &alice) >= amount * 2);
assert_eq!(CircuitBreaker::withdraw_limit_accumulator().0, 0);

Expand Down
Loading
Loading