Skip to content

Commit 97d9bc8

Browse files
committed
fix: estimate: auth list should be send unchecked to the runtime
The runtime api expect type `Vec<AuthorizationListItem>`, the client should pass the authorization list without any pre-conversion
1 parent 66b5fb8 commit 97d9bc8

File tree

2 files changed

+4
-43
lines changed

2 files changed

+4
-43
lines changed

client/rpc-core/src/types/transaction_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl From<TransactionRequest> for Option<TransactionMessage> {
269269
value,
270270
data: data_bytes,
271271
access_list,
272-
authorization_list: req.authorization_list.unwrap(),
272+
authorization_list: req.authorization_list.unwrap_or_default(),
273273
chain_id,
274274
})),
275275
// EIP1559: Has max_fee_per_gas but no gas_price, or all fee fields are None

client/rpc/src/eth/execute.rs

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -443,19 +443,6 @@ where
443443
.map(|item| (item.address, item.storage_keys))
444444
.collect::<Vec<(sp_core::H160, Vec<H256>)>>();
445445

446-
let authorization_list = authorization_list
447-
.unwrap_or_default()
448-
.iter()
449-
.map(|d| {
450-
(
451-
U256::from(d.chain_id),
452-
d.address,
453-
d.nonce,
454-
d.authorizing_address().ok(),
455-
)
456-
})
457-
.collect::<Vec<(U256, sp_core::H160, U256, Option<sp_core::H160>)>>();
458-
459446
let encoded_params = Encode::encode(&(
460447
&from.unwrap_or_default(),
461448
&to,
@@ -467,7 +454,7 @@ where
467454
&nonce,
468455
&false,
469456
&Some(access_list),
470-
&Some(authorization_list),
457+
&authorization_list,
471458
));
472459
let overlayed_changes = self.create_overrides_overlay(
473460
substrate_hash,
@@ -948,19 +935,6 @@ where
948935
.map(|item| (item.address, item.storage_keys))
949936
.collect::<Vec<(sp_core::H160, Vec<H256>)>>();
950937

951-
let authorization_list = authorization_list
952-
.unwrap_or_default()
953-
.iter()
954-
.map(|d| {
955-
(
956-
U256::from(d.chain_id),
957-
d.address,
958-
d.nonce,
959-
d.authorizing_address().ok(),
960-
)
961-
})
962-
.collect::<Vec<(U256, H160, U256, Option<H160>)>>();
963-
964938
let encoded_params = Encode::encode(&(
965939
&from.unwrap_or_default(),
966940
&to,
@@ -974,7 +948,7 @@ where
974948
&Some(
975949
access_list
976950
),
977-
&Some(authorization_list),
951+
&authorization_list,
978952
));
979953

980954
// Proof size recording
@@ -1136,19 +1110,6 @@ where
11361110
.map(|item| (item.address, item.storage_keys))
11371111
.collect::<Vec<(sp_core::H160, Vec<H256>)>>();
11381112

1139-
let authorization_list = authorization_list
1140-
.unwrap_or_default()
1141-
.iter()
1142-
.map(|d| {
1143-
(
1144-
U256::from(d.chain_id),
1145-
d.address,
1146-
d.nonce,
1147-
d.authorizing_address().ok(),
1148-
)
1149-
})
1150-
.collect::<Vec<(U256, H160, U256, Option<H160>)>>();
1151-
11521113
let encoded_params = Encode::encode(&(
11531114
&from.unwrap_or_default(),
11541115
&data,
@@ -1161,7 +1122,7 @@ where
11611122
&Some(
11621123
access_list
11631124
),
1164-
&Some(authorization_list),
1125+
&authorization_list,
11651126
));
11661127

11671128
// Enable proof size recording

0 commit comments

Comments
 (0)