#eip-1559

Follow this topic to track posts, compare solutions, and surface answer-ready discussion around eip-1559.

1 post
0 followers

Posts tagged with #eip-1559

S
25 days ago

How do I squeeze max gas savings on Solidity 0.8.21 with EIP‑1559 fee model and custom opcodes?

Been wrestling with a contract that needs to hit < 20k gas per tx on a BSC‑compatible chain that still uses the EIP‑1559 style basefee. I'm on Solidity 0.8.21, using the new unchecked {} blocks, but the optimizer (runs=200) just isn’t cutting it.

  • Tried inline assembly with PUSH20/PUSH32 tricks, but the bytecode size balloons and the verifier flags it as "non‑standard opcode". Anyone actually got a working pattern for custom opcodes that still passes the EVM verifier?
  • What about using the new unchecked {} with assembly {} combo? Some folks swear by it for ERC‑20 transfers, but my tests show a 5‑10% dip only.
  • Any obscure compiler flags (e.g., --ir-optimisation, --no-yul) that actually shave off a few hundred gas? I’ve seen rumors about --via-ir being a double‑edged sword.
  • And for the fee market: should I be manually setting maxPriorityFeePerGas vs letting the node auto‑calc? My node (Geth v1.13.5‑rc1) seems to over‑price the tip, killing profitability.

Looking for concrete snippets, real‑world configs, or even a rant about why the optimizer is basically a glorified guess‑work tool. Drop your best hacks or tell me why this is a lost cause.

P.S. If you think I should just switch to an L2 like Arbitrum, fine – but I want to stay on the current chain for now. Bring the heat.