Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 committed Oct 22, 2024
1 parent 7979bef commit 72a13c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (sva SignatureVerification) Initialize(config []byte) (types.Authenticator,
func (sva SignatureVerification) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error {
// First consume gas for verifying the signature
params := sva.ak.GetParams(ctx)
// Signature verification only accepts secp256k1 signatures so consume static gas here.
ctx.GasMeter().ConsumeGas(params.SigVerifyCostSecp256k1, "secp256k1 signature verification")

// after gas consumption continue to verify signatures
Expand Down
6 changes: 6 additions & 0 deletions protocol/x/clob/e2e/permissioned_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,12 @@ func TestPlaceOrder_PermissionedKeys_Success(t *testing.T) {
constants.Order_Alice_Num0_Id1_Clob1_Sell5_Price15_GTB20_IOC.OrderId: 0,
},
},
// Short term maker orders are explicitly removed when the permissioned key is removed. This
// is because short term orders go through another round of ante handler check during `DeliverTx`
// and we have to maintain the invariant that the operations queue is always valid.
//
// On contrast, stateful orders don't go through ante handlers and therefore we can allow these orders
// to be matched optimistically.
"Stateful maker order can be matched even if permissioned key is removed": {
smartAccountEnabled: true,
blocks: []TestBlockWithMsgs{
Expand Down

0 comments on commit 72a13c8

Please sign in to comment.