Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix call rate metering interceptor bug #5250

Merged

Conversation

ghubstan
Copy link
Contributor

@ghubstan ghubstan commented Feb 28, 2021

The gRPC interceptor was not using the correct method/ratemeter map key, and failing to find a rate meter for the server call.

  • Fix the rate meter key lookup bug.

  • Disable almost all strict, default call rate meters in tests.
    Made an adjustment to the test harness' scaffold setup so rate meter testing or disabling config file is always picked up by bob and alice daemons (not arb daemons because there is no dao-setup for that node).

  • Set arbitration daemon's registerDisputeAgent rate = 10/second.
    To not interfere with the test harness. (There is no pre-existing arb node appDataDir before that daemon starts.)

PR #5249 has to be reviewed/merged before this one.

The offer volume is shown so traders know how much fiat
they are sending or receiving without having to call getoffer.

Changed the 'Fiat Sent' and 'Fiat Received' column headers
to show which fiat is being transfered, e.g., 'EUR Sent',
'EUR Received'.

Adjusted apitest's trade-simulation-utils.sh to the modified
gettrade output.
A new handleExceptionAsWarning method logs warn(ex.msg) instead of
the full stack trace.
The gRPC interceptor was not using the correct method/ratemeter
map key, and failing to find a rate meter for the server call.

- Fix the rate meter key lookup bug.

- Disable most strict, default call rate meters in tests.
  Made an adjustment to the test harness' scaffold setup so an interceptor
  testing or disabling config file is always picked up by bob and alice
  daemons.

- Set arbitration daemon's registerDisputeAgent rate @ 10/second, so
  it does not interfere with the test harness.  (There is no pre-existing
  arb node appDataDir before that daemon starts.)

Note:  The test harness cannot install the custom rate metering file in
an arb daemon's appDataDir before it starts because there is no dao-setup
file for that node type.

TODO:  Adjust api simulation scripts to interceptor bug fix.
@ghubstan
Copy link
Contributor Author

Mainnet bats tests are working now.

This change replaces the hard coded strings used as keys in
interceptor rate-metering lookup maps.

Now, the fullMethodName defined in each bisq.proto.grpc.* class'
io.grpc.MethodDescriptor is used, not a hard coded String.

For example, the rate metering lookup key for 'GetBalances',
in 'GrpcWalletsService', is the

   fullMethodName = SERVICE_NAME + '/' + "GetBalances",

   where SERVICE_NAME = "io.bisq.protobuffer.Wallets".

Also adjusted affected tests, and tidy'd up interceptor logging.
Copy link
Contributor

@wallclockbuilder wallclockbuilder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UtAck

Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@sqrrm sqrrm merged commit 6f0f0ef into bisq-network:master Mar 9, 2021
@ghubstan ghubstan deleted the 03-fix-interceptor-method-key-lookup branch March 9, 2021 19:20
@ripcurlx ripcurlx added this to the v1.6.0 milestone Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants