forked from blockscout/blockscout
-
Notifications
You must be signed in to change notification settings - Fork 0
Sync upstream v11.2.8 (merge conflicts) #209
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
Open
JOY (JOY)
wants to merge
12
commits into
main
Choose a base branch
from
sync-upstream-v11.2.8
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dc16b0e
chore(deps): bump phoenix_live_view from 1.2.8 to 1.2.9 (#14714)
dependabot[bot] d8baca6
refactor: switch TAC operations in search to Read API v2 (#14719)
vbaranov bb0ff8a
perf: batch on-demand internal transaction trace requests (#14724)
vbaranov 5b15ab0
feat: add market source requests metric with endpoint type labels (#1…
vbaranov 86092e0
feat: add missing address native coin balances count indexer metric (…
vbaranov d7dbed5
chore(deps): bump tesla from 1.21.0 to 1.21.2 (#14736)
dependabot[bot] d341c37
chore(deps): bump phoenix_live_view from 1.2.9 to 1.2.10 (#14737)
dependabot[bot] b81e39b
fix: use cgroup memory limit for memory monitor in containers (#14739)
vbaranov b822f53
Add extra indexer monitor test suite
vbaranov 0da9169
v11.2.8
vbaranov 01a56de
v11.2.8 new env vars in CHANGELOG
vbaranov 23082aa
WIP: Merge upstream v11.2.8 (has conflicts)
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ dump.rdb | |
| .cursorrules | ||
| .elixir_ls | ||
| .claude/settings.local.json | ||
| .claude/commands/review-pr.md | ||
|
|
||
| **.dec** | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
apps/block_scout_web/lib/block_scout_web/schemas/api/v2/search/result_item.ex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # SPDX-License-Identifier: LicenseRef-Blockscout | ||
| defmodule BlockScoutWeb.Schemas.API.V2.Search.ResultItem do | ||
| @moduledoc """ | ||
| This module defines the schema for a single item of the search results. | ||
|
|
||
| Only `tac_operation` is typed so far. The other result types (address, block, transaction, | ||
| token, etc.) are not described individually yet, so additional properties are deliberately | ||
| allowed and this schema only constrains an item that carries a TAC operation. | ||
| """ | ||
| require OpenApiSpex | ||
|
|
||
| alias BlockScoutWeb.Schemas.API.V2.Search.TacOperation | ||
|
|
||
| OpenApiSpex.schema(%{ | ||
| title: "SearchResultItem", | ||
| description: "Single search result. The shape depends on `type`; only `tac_operation` results are fully described.", | ||
| type: :object, | ||
| properties: %{ | ||
| tac_operation: TacOperation | ||
| }, | ||
| required: [] | ||
| }) | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
apps/block_scout_web/lib/block_scout_web/schemas/api/v2/search/tac_operation.ex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # SPDX-License-Identifier: LicenseRef-Blockscout | ||
| defmodule BlockScoutWeb.Schemas.API.V2.Search.TacOperation do | ||
| @moduledoc """ | ||
| This module defines the schema for a TAC operation in the search results. | ||
|
|
||
| The object is returned by the `tac-operation-lifecycle` microservice (Read API v2) and is | ||
| proxied verbatim, so this schema mirrors the microservice contract rather than describing a | ||
| Blockscout-owned struct. | ||
| """ | ||
| require OpenApiSpex | ||
|
|
||
| alias BlockScoutWeb.Schemas.API.V2.General | ||
| alias OpenApiSpex.Schema | ||
|
|
||
| @type_enum [ | ||
| "UNKNOWN", | ||
| "TON_TAC_TON", | ||
| "TAC_TON", | ||
| "TON_TAC" | ||
| ] | ||
|
|
||
| @status_enum [ | ||
| "pending", | ||
| "success", | ||
| "failed" | ||
| ] | ||
|
|
||
| @blockchain_enum [ | ||
| "TAC", | ||
| "TON", | ||
| "UNKNOWN_BLOCKCHAIN" | ||
| ] | ||
|
|
||
| @sender_schema %Schema{ | ||
| type: :object, | ||
| properties: %{ | ||
| address: %Schema{ | ||
| type: :string, | ||
| nullable: false, | ||
| description: "TAC (EVM) or TON address, depending on `blockchain`", | ||
| example: "EQDoF2OkxsI3gc5jAuxlqozN9H/SgEOUCopMa1yU4djLaXuL" | ||
| }, | ||
| blockchain: %Schema{type: :string, enum: @blockchain_enum, nullable: false, example: "TON"} | ||
| }, | ||
| required: [:address, :blockchain], | ||
| additionalProperties: false, | ||
| nullable: true | ||
| } | ||
|
|
||
| OpenApiSpex.schema(%{ | ||
| title: "TacOperationSearchResult", | ||
| description: "TAC operation as returned by the tac-operation-lifecycle service Read API v2.", | ||
| type: :object, | ||
| properties: %{ | ||
| operation_id: %Schema{ | ||
| type: :string, | ||
| nullable: false, | ||
| example: "0xf01646ac36cbbcebd8a5ff09c300d5f3bebdd2fbe0135a377eaa485d9edcc670" | ||
| }, | ||
| type: %Schema{ | ||
| type: :string, | ||
| enum: @type_enum, | ||
| nullable: false, | ||
| description: "Transfer route. Never carries a lifecycle outcome — see `status` and `rollback`.", | ||
| example: "TAC_TON" | ||
| }, | ||
| status: %Schema{ | ||
| type: :string, | ||
| enum: @status_enum, | ||
| nullable: false, | ||
| description: "Business outcome of the operation.", | ||
| example: "success" | ||
| }, | ||
| rollback: %Schema{ | ||
| type: :boolean, | ||
| nullable: false, | ||
| description: "Whether a rollback occurred.", | ||
| example: false | ||
| }, | ||
| timestamp: General.Timestamp, | ||
| sender: @sender_schema, | ||
| error_reason: %Schema{ | ||
| type: :string, | ||
| nullable: true, | ||
| description: | ||
| "Short failure label. It is published only when the stored reason is short enough to be a label, so it is legitimately `null` on a failed operation — its absence does not imply success.", | ||
| example: "Insufficient Fee" | ||
| } | ||
| }, | ||
| required: [:operation_id, :type, :status, :rollback, :timestamp], | ||
| additionalProperties: false | ||
| }) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current schema is very permissive as it has no required fields and allows any additional properties. While the moduledoc explains that other types are not fully described yet, the schema could be made more robust.
Consider making the
typefield required and documenting other common fields. This would improve API documentation and allow for better client-side validation.For example:
This would still allow other properties for other types, but would enforce the presence of the
typefield.