base-org / node

Everything required to run your own Base node
MIT License
68.12k stars 2.51k forks source link

Can't deploy ERC-1820, non-EIP-155 protected txs rejected even with --rpc.allow-unprotected-txs set #53

Closed d10r closed 1 year ago

d10r commented 1 year ago

I'm trying to deploy ERC-1820 for the Superfluid protocol. That requires a non-EIP-155 tx ("Nick's method"). I synced a testnet node and expected this to work after starting it with the flag --rpc.allow-unprotected-txs=true. However it still fails, with the node printing this log message:

geth_1  | WARN [05-31|11:56:48.983] Served eth_sendRawTransaction            conn=172.26.0.1:41282 reqid=15               duration=155.265946ms err="only replay-protected (EIP-155) transactions allowed over RPC"

Please advise me how to allow non-EIP-155 txs on my local node. Alternatively, please deploy ERC-1820. Other protocols may eventually need it too.

roberto-bayardo commented 1 year ago

Unfortunately there's no way to enable pre eip-155 transactions (they are filtered by the sequencer) but can you use the deterministic deployment proxy instead? https://github.com/Arachnid/deterministic-deployment-proxy

This is deployed on Base goerli.

roberto-bayardo commented 1 year ago

Hmm looking more deeply I don't think you'd get the same address if you were to use the deterministic deployment proxy. Let me look into deploying ERC-1820 ourselves.

cc: @mdehoog

d10r commented 1 year ago

If deploying the ERC-1820 registry contract in any other way than specified in its EIP, it will end up having a different address, which kind of defies the point and would make it standard incompliant.

So while the deterministic deployment proxy you mention isn't helpful per se here, it shows that ERC-1820 could be deployed as intended. That is because it's using the same deployment methods as that deterministic deployment proxy was deployed with: via Nick's method:

> await web3.eth.getTransaction("0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26")
{
  blockHash: '0x87642b12d613a8c125d0becab5e0ab434367c0cab44c6203d4fb6ec7385ab4cd',
  blockNumber: 1817106,
  from: '0x3fAB184622Dc19b6109349B94811493BF2a45362',
  gas: 100000,
  gasPrice: '100000000000',
  hash: '0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26',
  input: '0x604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3',
  nonce: 0,
  to: null,
  transactionIndex: 2,
  value: '0',
  type: 0,
  v: '0x1b',
  r: '0x2222222222222222222222222222222222222222222222222222222222222222',
  s: '0x2222222222222222222222222222222222222222222222222222222222222222'
}

Which means it's technically possible to do such txs on Base, but with the sequencer not allowing them, I guess somebody in the team with privileged access needs to do it.

In case you want to better understand the relevance of ERC-1820, here's transactions interacting with it on Ethereum mainnet.

roberto-bayardo commented 1 year ago

Yes we can disable the pre-155 filter on the sequencer to submit these kinds of txs. They are disabled by default in optimism bedrock. Will circle back when we get this deployed.

philipandersson commented 1 year ago

@roberto-bayardo Appreciate that! Please let us know as soon as you can deploy this. Right now this is blocker for us deploying our protocol onto BASE.

roberto-bayardo commented 1 year ago

Here ya go! https://goerli.basescan.org/tx/0xfefb2da535e927b85fe68eb81cb2e4a5827c905f78381a01ef2322aa9b0aee8e

Please confirm this suits your needs. We'll be enabling pre-155 txs more broadly so in the future you should be able to submit these on your own with the appropriate node/rpc support.

philipandersson commented 1 year ago

@roberto-bayardo Thanks a lot, should be working from what I can tell.