File tree Expand file tree Collapse file tree
batcher/aligned-batcher/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -750,6 +750,18 @@ impl Batcher {
750750 return Ok ( ( ) ) ;
751751 } ;
752752
753+ if msg_max_fee > user_last_max_fee_limit {
754+ std:: mem:: drop ( batch_state_lock) ;
755+ warn ! ( "Invalid max fee for address {addr}, had fee limit of {user_last_max_fee_limit:?}, sent {msg_max_fee:?}" ) ;
756+ send_message (
757+ ws_conn_sink. clone ( ) ,
758+ SubmitProofResponseMessage :: InvalidMaxFee ,
759+ )
760+ . await ;
761+ self . metrics . user_error ( & [ "invalid_max_fee" , "" ] ) ;
762+ return Ok ( ( ) ) ;
763+ }
764+
753765 let Some ( user_accumulated_fee) = batch_state_lock. get_user_total_fees_in_queue ( & addr) . await
754766 else {
755767 std:: mem:: drop ( batch_state_lock) ;
@@ -814,18 +826,6 @@ impl Batcher {
814826 return Ok ( ( ) ) ;
815827 }
816828
817- if msg_max_fee > user_last_max_fee_limit {
818- std:: mem:: drop ( batch_state_lock) ;
819- warn ! ( "Invalid max fee for address {addr}, had fee limit of {user_last_max_fee_limit:?}, sent {msg_max_fee:?}" ) ;
820- send_message (
821- ws_conn_sink. clone ( ) ,
822- SubmitProofResponseMessage :: InvalidMaxFee ,
823- )
824- . await ;
825- self . metrics . user_error ( & [ "invalid_max_fee" , "" ] ) ;
826- return Ok ( ( ) ) ;
827- }
828-
829829 // * ---------------------------------------------------------------------*
830830 // * Add message data into the queue and update user state *
831831 // * ---------------------------------------------------------------------*
You can’t perform that action at this time.
0 commit comments