Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Jan 16, 2024
1 parent 1355464 commit 62dec77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions access/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func NewTransactionValidatorWithLimiter(
}

func (v *TransactionValidator) Validate(tx *flow.TransactionBody) (err error) {
// rate limit transactions for specific payers.
// a short term solution to prevent attracks that send too many failed transactions
// if a transaction is from a payer that should be rate limited, all the following
// checks will be skipped
err = v.checkRateLimitPayer(tx)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion engine/collection/ingest/rate_limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestLimiterAddRemoveAddress(t *testing.T) {
require.True(t, l.IsRateLimited(limited2))
}

func TestLImiterBurst(t *testing.T) {
func TestLimiterBurst(t *testing.T) {
t.Parallel()

limited1 := unittest.RandomAddressFixture()
Expand Down

0 comments on commit 62dec77

Please sign in to comment.