[Flow EVM] Add test cases for restricted EOA functionality#8297
[Flow EVM] Add test cases for restricted EOA functionality#8297
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
janezpodhostnik
left a comment
There was a problem hiding this comment.
Are we keeping this feature or is it temporary?
If we are keeping it, we probably want to change some wording in the errors...
| WithTransactionTracer(ctx.Tracer), | ||
| WithBlockTotalGasUsedSoFar(ctx.TotalGasUsedSoFar), | ||
| WithBlockTxCountSoFar(ctx.TxCountSoFar), | ||
| WithRestrictedEOAs(restrictedEOAs), |
There was a problem hiding this comment.
I would make the restrictedEOAs a map[ChainId]gethCommon.Address, so that their definition is cleaner and we can easily tell which are for mainnet/testnet/etc.
There was a problem hiding this comment.
Well, I don't think that we actually want to distinguish between networks. If someone had a malicious activity on Testnet, then we certainly don't want their EOA to also interact with Mainnet too. The opposite is also true.
Keep in mind that wallets such as MetaMask, will use the same address between networks, as EOAs are controller by a private key only.
@janezpodhostnik Yes, these EOAs will be permanently restricted from accessing Flow EVM. But the error was actually written by comms team. What do you have in mind as an error message? |
|
We might need this feature in the future which means the error message maybe shouldn't mention a specific attack:
->
|
Good point, updated in 0972247 . |
| // This is only a test EOA, used during tests | ||
| gethCommon.HexToAddress("0xad7cBF4b6edAd1A4Bc08Fa74741445918B3C54f4"), |
There was a problem hiding this comment.
suggestion: restrictedEOAs is a variable. we could add the test EOA during the test so its not listed here.
There was a problem hiding this comment.
Good point indeed 👍 Updated in 03e3c7e .
0972247 to
5fc0247
Compare
5fc0247 to
03e3c7e
Compare
reclaimFundsFromAttackerEOAsfunction fromEVMcontract code