MCPcopy Create free account
hub / github.com/base/base / validate_payer_auth

Method validate_payer_auth

crates/execution/txpool/src/validator.rs:1877–1900  ·  view source on GitHub ↗

Ensures `payer_auth` is present iff a `payer` is set. Open payer mode carries a raw 65-byte signature; a named payer carries an allowed `authenticator || data` blob.

(signed: &Eip8130Signed)

Source from the content-addressed store, hash-verified

1875 /// carries a raw 65-byte signature; a named payer carries an allowed
1876 /// `authenticator || data` blob.
1877 fn validate_payer_auth(signed: &Eip8130Signed) -> Result<(), InvalidPoolTransactionError> {
1878 let payer_present = signed.tx().payer.is_some();
1879 let auth = signed.payer_auth();
1880 // XOR: presence must match.
1881 if payer_present == auth.is_empty() {
1882 return Err(InvalidTransactionError::TxTypeNotSupported.into());
1883 }
1884 if signed.tx().is_open_payer() {
1885 if auth.len() != 65 {
1886 return Err(InvalidTransactionError::TxTypeNotSupported.into());
1887 }
1888 } else if payer_present {
1889 if auth.len() < 20 {
1890 return Err(InvalidTransactionError::TxTypeNotSupported.into());
1891 }
1892 let authenticator = Address::from_slice(&auth[..20]);
1893 if !Self::authenticator_allowed_for_tx_path(&authenticator)
1894 || !Self::authenticator_payload_well_formed(&authenticator, &auth[20..])
1895 {
1896 return Err(InvalidTransactionError::TxTypeNotSupported.into());
1897 }
1898 }
1899 Ok(())
1900 }
1901
1902 /// Returns `true` when `authenticator` falls outside the live mempool policy
1903 /// range. Mirrors the check in [`Self::validate_initial_actors`] and

Callers

nothing calls this directly

Calls 6

is_someMethod · 0.80
payer_authMethod · 0.80
is_open_payerMethod · 0.80
txMethod · 0.45
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected