test_account_write_authority_is_recipient()¶
Documentation for tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_authorization_charges.py::test_account_write_authority_is_recipient@26332146.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_authorization_charges.py::test_account_write_authority_is_recipient --fork Amsterdam
An authority that is also tx.to pays ACCOUNT_WRITE only when
the transaction moves no value to it.
The charge depends on whether the transaction transfers value:
zero_value: no value is transferred, so at authorization-processing timetx.tohas not been written yet (only the sender is written at inclusion). The delegation write is the transaction's first write to it, soACCOUNT_WRITEis charged.non-zero_value: the transaction already pays to writetx.towhen it transfers value to it, so the delegation write is not the first write and noACCOUNT_WRITEaccrues.
This resolves the EIP text's "(i.e. the authority differs from
tx.to)" parenthetical: the rule is first-write tracking, and
tx.to counts as pre-written only when the transaction moves
value to it.
Either way the authorization writes a net-new delegation indicator
(AUTH_BASE), and after it applies the recipient is delegated, so
the top frame additionally resolves the delegation target at the
cold rate before dispatching its code (a STOP).
Source code in tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_authorization_charges.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
Parametrized Test Cases¶
This test generates 2 parametrized test cases across 1 fork.