Skip to content

Commit b7e2dcc

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 b7e2dcc

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
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: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -948,19 +948,6 @@ where
948948
.map(|item| (item.address, item.storage_keys))
949949
.collect::<Vec<(sp_core::H160, Vec<H256>)>>();
950950

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-
964951
let encoded_params = Encode::encode(&(
965952
&from.unwrap_or_default(),
966953
&to,
@@ -974,7 +961,7 @@ where
974961
&Some(
975962
access_list
976963
),
977-
&Some(authorization_list),
964+
&authorization_list,
978965
));
979966

980967
// Proof size recording
@@ -1136,19 +1123,6 @@ where
11361123
.map(|item| (item.address, item.storage_keys))
11371124
.collect::<Vec<(sp_core::H160, Vec<H256>)>>();
11381125

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-
11521126
let encoded_params = Encode::encode(&(
11531127
&from.unwrap_or_default(),
11541128
&data,
@@ -1161,7 +1135,7 @@ where
11611135
&Some(
11621136
access_list
11631137
),
1164-
&Some(authorization_list),
1138+
&authorization_list,
11651139
));
11661140

11671141
// Enable proof size recording

0 commit comments

Comments
 (0)