Skip to content

fix(loadnext): use requestL2TransactionBridgehub in ETH deposit path#349

Closed
cryptocake wants to merge 1 commit intovianetwork:mainfrom
cryptocake:fix/issue-347-loadnext-bridgehub
Closed

fix(loadnext): use requestL2TransactionBridgehub in ETH deposit path#349
cryptocake wants to merge 1 commit intovianetwork:mainfrom
cryptocake:fix/issue-347-loadnext-bridgehub

Conversation

@cryptocake
Copy link
Copy Markdown

Summary

Migrate the loadnext ETH deposit request path away from deprecated requestL2Transaction to requestL2TransactionBridgehub in both loadtest SDK variants.

Changes

  • core/tests/loadnext/src/sdk/ethereum/mod.rs
    • switched encoded function from requestL2Transaction -> requestL2TransactionBridgehub
    • updated EVM-571 comment wording to remove deprecated-method reference
  • core/tests/via_loadnext/src/sdk/ethereum/mod.rs
    • switched encoded function from requestL2Transaction -> requestL2TransactionBridgehub
    • updated EVM-571 comment wording to remove deprecated-method reference

Why

This keeps the loadnext request path aligned with the Bridgehub-compatible method exposed in current ABI surfaces and reduces continued reliance on deprecated Mailbox method naming.

Validation

  • Verified both loadnext SDK files now encode requestL2TransactionBridgehub
  • Verified no requestL2Transaction function string remains in those two files

Linked issues

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Ethereum provider in the loadnext and via_loadnext test suites by renaming the L2 transaction request method to requestL2TransactionBridgehub and updating related TODO comments. Feedback indicates a potential mismatch with the contract ABI, specifically regarding the function name and the use of positional arguments instead of a single request struct.

let value = base_cost + operator_tip + l2_value;
let tx_data = self.client().encode_tx_data(
"requestL2Transaction",
"requestL2TransactionBridgehub",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The function name requestL2TransactionBridgehub appears to be a typo. In the ZKsync Era Mailbox facet (the main contract), the Bridgehub-compatible method is typically named bridgehubRequestL2Transaction. Furthermore, that method usually expects a single L2TransactionRequestDirect struct as an argument (which includes a chainId), whereas this code continues to pass 7 positional arguments. If the intention was to align with the Bridgehub contract directly, the method name in the provided IBridgehub.json is requestL2TransactionDirect. Please verify the correct function name and signature against the updated ABI.

let value = base_cost + operator_tip + l2_value;
let tx_data = self.client().encode_tx_data(
"requestL2Transaction",
"requestL2TransactionBridgehub",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The function name requestL2TransactionBridgehub appears to be a typo. In the ZKsync Era Mailbox facet (the main contract), the Bridgehub-compatible method is typically named bridgehubRequestL2Transaction. Furthermore, that method usually expects a single L2TransactionRequestDirect struct as an argument (which includes a chainId), whereas this code continues to pass 7 positional arguments. If the intention was to align with the Bridgehub contract directly, the method name in the provided IBridgehub.json is requestL2TransactionDirect. Please verify the correct function name and signature against the updated ABI.

@cryptocake cryptocake force-pushed the fix/issue-347-loadnext-bridgehub branch from abea8bb to b9a1886 Compare April 1, 2026 10:04
@cryptocake
Copy link
Copy Markdown
Author

Good catch on the ABI mismatch. Updated this PR to match the hyperchain ABI shape.

Changes made:

  • switched method to bridgehubRequestL2Transaction
  • switched args to a single BridgehubL2TransactionRequest tuple
  • included sender and mintValue in the tuple
  • removed msg.value from tx options to match the nonpayable signature

Patch is pushed on the same branch.

@cryptocake
Copy link
Copy Markdown
Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Ethereum SDK used in load tests to use the bridgehubRequestL2Transaction method instead of requestL2Transaction, adjusting the transaction data encoding accordingly. However, the removal of the f.value assignment in the transaction options will cause these transactions to revert on-chain, as no ETH will be sent to cover the required mint_value (base cost, operator tip, and L2 value).

Comment on lines 431 to 434
Options::with(|f| {
f.gas = Some(U256::from(300000));
f.value = Some(value);
f.gas_price = Some(gas_price)
}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The f.value field has been removed from the transaction options. In the ETH deposit path, the transaction must include msg.value to cover the mint_value (which includes the base cost, operator tip, and L2 value). Without setting f.value, the transaction will be sent with 0 ETH, causing it to revert on the L1 contract.

Suggested change
Options::with(|f| {
f.gas = Some(U256::from(300000));
f.value = Some(value);
f.gas_price = Some(gas_price)
}),
Options::with(|f| {
f.gas = Some(U256::from(300000));
f.value = Some(mint_value);
f.gas_price = Some(gas_price)
}),

Comment on lines 430 to 433
Options::with(|f| {
f.gas = Some(U256::from(300000));
f.value = Some(value);
f.gas_price = Some(gas_price)
}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The f.value field is missing in the transaction options. This is required to send the necessary ETH (mint_value) for the L2 transaction request. Removing it will lead to transaction failure as no ETH will be sent to the contract.

Suggested change
Options::with(|f| {
f.gas = Some(U256::from(300000));
f.value = Some(value);
f.gas_price = Some(gas_price)
}),
Options::with(|f| {
f.gas = Some(U256::from(300000));
f.value = Some(mint_value);
f.gas_price = Some(gas_price)
}),

@cryptocake
Copy link
Copy Markdown
Author

Closing this PR due to migration-scope and ABI-semantics ambiguity. Will replace with a stricter, minimal, ABI-verified change.

@cryptocake cryptocake closed this Apr 1, 2026
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.

1 participant