Skip to content

Commit

Permalink
fix(contracts): prevent old vals from exploiting new src chains (omni…
Browse files Browse the repository at this point in the history
…-network#1133)

Prevent old validator sets from creating xsubmissions for
 newly supported or unsupported source chains.
 
Additionally, require xmsg.sourceChainId matches
xsub.blockHeader.sourceChainId


task: https://app.asana.com/0/1206208509925075/1207428329960053
  • Loading branch information
kevinhalliday authored May 29, 2024
1 parent 30181db commit 2cf6be4
Show file tree
Hide file tree
Showing 18 changed files with 153 additions and 73 deletions.
58 changes: 29 additions & 29 deletions contracts/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ OmniAVS_canRegister_Test:test_canRegister_notOperator() (gas: 119994)
OmniAVS_initialize_Test:test_initialize_defaultParams_succeeds() (gas: 3588147)
OmniAVS_syncWithOmni_Test:test_depositBeaconEth_succeeds() (gas: 630918)
OmniAVS_syncWithOmni_Test:test_unsupportedStrategyDeposit_succeeds() (gas: 1532940)
OmniPortal_admin_Test:test_pause() (gas: 64866834)
OmniPortal_admin_Test:test_setFeeOracle() (gas: 34909)
OmniPortal_admin_Test:test_pause() (gas: 64850137)
OmniPortal_admin_Test:test_setFeeOracle() (gas: 34953)
OmniPortal_adversarial:test_xcallToPortal_adminFunc_fails() (gas: 82800)
OmniPortal_adversarial:test_xcallToPortal_internalFunction_fails() (gas: 57901)
OmniPortal_adversarial:test_xcallToPortal_selfXCall_fails() (gas: 93714)
Expand All @@ -78,40 +78,40 @@ OmniPortal_exec_Test:test_exec_notEnoughGas_reverts() (gas: 4996992)
OmniPortal_exec_Test:test_exec_wrongChainId_reverts() (gas: 26298)
OmniPortal_exec_Test:test_exec_xmsgRevert_succeeds() (gas: 71152)
OmniPortal_exec_Test:test_exec_xmsg_succeeds() (gas: 129162)
OmniPortal_feeFor_Test:test_feeFor_defaultGasLimit_succeeds() (gas: 45336)
OmniPortal_feeFor_Test:test_feeFor_succeeds() (gas: 41807)
OmniPortal_xcall_Test:test_xcall_defaultGasLimit_succeeds() (gas: 108968)
OmniPortal_feeFor_Test:test_feeFor_defaultGasLimit_succeeds() (gas: 45380)
OmniPortal_feeFor_Test:test_feeFor_succeeds() (gas: 41829)
OmniPortal_xcall_Test:test_xcall_defaultGasLimit_succeeds() (gas: 108990)
OmniPortal_xcall_Test:test_xcall_explicitGasLimit_succeeds() (gas: 109226)
OmniPortal_xcall_Test:test_xcall_gasLimitTooHigh_reverts() (gas: 70531)
OmniPortal_xcall_Test:test_xcall_gasLimitTooLow_reverts() (gas: 70807)
OmniPortal_xcall_Test:test_xcall_insufficientFee_reverts() (gas: 72900)
OmniPortal_xcall_Test:test_xcall_sameChain_reverts() (gas: 59952)
OmniPortal_xcall_Test:test_xcall_unsupportedChain_reverts() (gas: 43847)
OmniPortal_xsubmit_Test:test_xsubmit_addValidatorSet_succeeds() (gas: 65535232)
OmniPortal_xsubmit_Test:test_xsubmit_duplicateValidator_reverts() (gas: 64509952)
OmniPortal_xsubmit_Test:test_xsubmit_invalidAttestationRoot_reverts() (gas: 64554765)
OmniPortal_xsubmit_Test:test_xsubmit_invalidMsgs_reverts() (gas: 64542145)
OmniPortal_xsubmit_Test:test_xsubmit_noQuorum_reverts() (gas: 64516744)
OmniPortal_xsubmit_Test:test_xsubmit_noXmsgs_reverts() (gas: 64492044)
OmniPortal_xsubmit_Test:test_xsubmit_notNewValSet_succeeds() (gas: 65506995)
OmniPortal_xsubmit_Test:test_xsubmit_oldValSet_reverts() (gas: 66090795)
OmniPortal_xsubmit_Test:test_xsubmit_reentrancy_reverts() (gas: 64630259)
OmniPortal_xsubmit_Test:test_xsubmit_uknownValSetId_reverts() (gas: 64500211)
OmniPortal_xsubmit_Test:test_xsubmit_wrongChainId_reverts() (gas: 64586493)
OmniPortal_xsubmit_Test:test_xsubmit_wrongStreamOffset_reverts() (gas: 64588991)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_chainB_succeeds() (gas: 64774202)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_succeeds() (gas: 64774311)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_chainB_succeeds() (gas: 65436622)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_succeeds() (gas: 65436738)
OmniPortal_xsubmit_gas_Test:test_singleExec() (gas: 65057790)
OmniPortal_xsubmit_gas_Test:test_xsubmi_addValidator_succeeds() (gas: 64690486)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle10_succeeds() (gas: 65741294)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_succeeds() (gas: 64707358)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle25_succeeds() (gas: 67465258)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_succeeds() (gas: 70340274)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle5_succeeds() (gas: 65166924)
OmniPortal_xsubmit_Test:test_xsubmit_addValidatorSet_succeeds() (gas: 65501963)
OmniPortal_xsubmit_Test:test_xsubmit_duplicateValidator_reverts() (gas: 64509966)
OmniPortal_xsubmit_Test:test_xsubmit_invalidAttestationRoot_reverts() (gas: 64554779)
OmniPortal_xsubmit_Test:test_xsubmit_invalidMsgs_reverts() (gas: 64542159)
OmniPortal_xsubmit_Test:test_xsubmit_noQuorum_reverts() (gas: 64516758)
OmniPortal_xsubmit_Test:test_xsubmit_noXmsgs_reverts() (gas: 64492055)
OmniPortal_xsubmit_Test:test_xsubmit_notNewValSet_succeeds() (gas: 65470633)
OmniPortal_xsubmit_Test:test_xsubmit_oldValSet_reverts() (gas: 66057768)
OmniPortal_xsubmit_Test:test_xsubmit_reentrancy_reverts() (gas: 64610594)
OmniPortal_xsubmit_Test:test_xsubmit_uknownValSetId_reverts() (gas: 64497818)
OmniPortal_xsubmit_Test:test_xsubmit_wrongChainId_reverts() (gas: 64566828)
OmniPortal_xsubmit_Test:test_xsubmit_wrongStreamOffset_reverts() (gas: 64569326)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_chainB_succeeds() (gas: 64757505)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_succeeds() (gas: 64757614)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_chainB_succeeds() (gas: 65423649)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_succeeds() (gas: 65423765)
OmniPortal_xsubmit_gas_Test:test_singleExec() (gas: 65057812)
OmniPortal_xsubmit_gas_Test:test_xsubmit_addValidator_succeeds() (gas: 64670779)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle10_succeeds() (gas: 65728329)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_succeeds() (gas: 64687715)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle25_succeeds() (gas: 67463423)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_succeeds() (gas: 70356989)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle5_succeeds() (gas: 65150138)
Omni_Test:test_constructor() (gas: 1006927)
PortalRegistry_Test:test_register() (gas: 808342)
PortalRegistry_Test:test_register() (gas: 818023)
Quorum_Test:test_verify_allInvalidSigs_reverts() (gas: 281140)
Quorum_Test:test_verify_duplicateValidator_reverts() (gas: 283391)
Quorum_Test:test_verify_invalidSignature_reverts() (gas: 282508)
Expand Down
Loading

0 comments on commit 2cf6be4

Please sign in to comment.