Skip to content

fix: Unsupported method handling#2198

Merged
nimrod-teich merged 10 commits into
mainfrom
unsupported-method-handling
Jan 28, 2026
Merged

fix: Unsupported method handling#2198
nimrod-teich merged 10 commits into
mainfrom
unsupported-method-handling

Conversation

@Tomelia1999

Copy link
Copy Markdown
Contributor

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • read the contribution guide
  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the main branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

commit fb63065
Author: Tomelia1999 <tom.elia99@gmail.com>
Date:   Wed Jan 21 13:58:54 2026 +0100

    remove functionality duplication

commit 37251cb
Author: Tomelia1999 <tom.elia99@gmail.com>
Date:   Thu Jan 15 18:32:01 2026 +0200

    WIP: unsupported method - bytes comparison instead of stign comparison

commit 298dce8
Author: Tomelia1999 <tom.elia99@gmail.com>
Date:   Mon Jan 5 18:19:16 2026 +0200

    unify functions + adding unit tests

commit 057da85
Author: Tomelia1999 <tom.elia99@gmail.com>
Date:   Mon Jan 5 14:54:35 2026 +0200

    improve flow of unsupported method
@Tomelia1999 Tomelia1999 changed the title Unsupported method handling fix: Unsupported method handling Jan 21, 2026
@codecov

codecov Bot commented Jan 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.72727% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
protocol/rpcconsumer/rpcconsumer_server.go 0.00% 30 Missing ⚠️
protocol/chainlib/node_error_handler.go 40.00% 2 Missing and 1 partial ⚠️
protocol/relaycore/relay_processor.go 0.00% 2 Missing ⚠️
protocol/rpcsmartrouter/rpcsmartrouter_server.go 0.00% 2 Missing ⚠️
Flag Coverage Δ
consensus 8.54% <100.00%> (+<0.01%) ⬆️
protocol 33.85% <32.72%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
protocol/chainlib/jsonRPC.go 44.70% <ø> (+0.47%) ⬆️
protocol/chainlib/tendermintRPC.go 40.15% <ø> (+0.39%) ⬆️
protocol/common/endpoints.go 0.00% <ø> (ø)
protocol/common/errors.go 100.00% <100.00%> (ø)
protocol/lavasession/used_providers.go 64.49% <100.00%> (-1.49%) ⬇️
protocol/rpcprovider/provider_state_machine.go 65.10% <100.00%> (+0.23%) ⬆️
protocol/relaycore/relay_processor.go 50.25% <0.00%> (+0.12%) ⬆️
protocol/rpcsmartrouter/rpcsmartrouter_server.go 31.65% <0.00%> (+1.39%) ⬆️
protocol/chainlib/node_error_handler.go 34.26% <40.00%> (-15.16%) ⬇️
protocol/rpcconsumer/rpcconsumer_server.go 30.34% <0.00%> (+0.72%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jan 21, 2026

Copy link
Copy Markdown

Test Results

    7 files  ±  0     85 suites  ±0   30m 22s ⏱️ - 3m 5s
3 320 tests +137  3 319 ✅ +137  1 💤 ±0  0 ❌ ±0 
3 513 runs  +247  3 512 ✅ +247  1 💤 ±0  0 ❌ ±0 

Results for commit 5787102. ± Comparison against base commit f0e3d53.

This pull request removes 9 and adds 146 tests. Note that renamed tests count towards both.
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestGetUnsupportedMethodPatterns
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestSpecificErrorFromUser/Message_pattern_detection
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds/empty_response_ID_-_error_with_parsing_failure
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds/invalid_JSON_in_request_ID_-_error
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds/matching_IDs_-_success
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds/matching_string_IDs_-_success
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds/mismatched_IDs_-_error
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestValidateRequestAndResponseIds/null_response_ID_-_error
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Actual_endpoint_not_found
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Actual_method_not_found
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Actual_route_not_found
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Generic_not_found_without_execution_reverted
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Item_not_found
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/JSON-RPC_method_not_supported
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Smart_contract_IdentityRegistry_specific
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Smart_contract_NFT_not_found
github.com/lavanet/lava/v5/protocol/chainlib ‑ TestIsUnsupportedMethodErrorMessage_SmartContractErrors/Smart_contract_Record_not_found
…

♻️ This comment has been updated with latest results.

return true
}
}

@Tomelia1999 Tomelia1999 Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can remove that part below (iterating protocol errors and looking for unsupportedMethod errors), since that fix do not return the unsupportedMethods errors as a protocol error.
We only need to extract the epochMismatch validation and put it in a dedicated function, since "HasUnsupportedMethodErrors" is not the appropriate peace of code to host that validation.

waiting for reviewers opinion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nimrod-teich nimrod-teich merged commit e4f7444 into main Jan 28, 2026
31 checks passed
@nimrod-teich nimrod-teich deleted the unsupported-method-handling branch January 28, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants