-
Notifications
You must be signed in to change notification settings - Fork 32
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
Updates Linea svg in synapse constants #2928
Conversation
WalkthroughThis update enhances the application by integrating the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant GraphQL
participant DB
User->>UI: Request Daily Stats
UI->>GraphQL: Query GetDailyStatisticsByChain
GraphQL->>DB: Fetch Data (base, blast, scroll, linea)
DB-->>GraphQL: Return Data
GraphQL-->>UI: Return Stats
UI-->>User: Display Stats
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Deploying sanguine-fe with Cloudflare Pages
|
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.
Caution
Inline review comments failed to post
Actionable comments posted: 4
Outside diff range, codebase verification and nitpick comments (1)
packages/synapse-constants/scripts/generateMaps.js (1)
3-4
: Update the import paths to the correct locations.The following files exist in the repository but are not in the paths specified in the import statements. Here are the correct paths:
./utils/prettyPrintTs
should be./utils/prettyPrintTs.js
./utils/fetchRfqData
should be./utils/fetchRfqData.js
./data/providers.json
is correct./data/ignoredBridgeSymbols.json
is correct./data/symbolOverrides.json
is correct./abi/SynapseRouter.json
is correct./abi/SynapseCCTP.json
is correct./abi/SynapseCCTPRouter.json
is correct./abi/SwapQuoter.json
is correct./abi/IERC20Metadata.json
is correct./abi/IDefaultPool.json
is correctPlease update the import statements to reflect these correct paths.
Analysis chain
Verify the correctness of the new import paths.
The import paths have been modified to stay within the same directory. Ensure that these paths are correct and that the files exist in the specified locations.
Also applies to: 6-6, 8-8, 10-10, 12-17
The specified import paths are incorrect or the files are missing from the repository.
The following files were not found in the specified paths:
./utils/prettyPrintTs
./utils/fetchRfqData
./data/providers.json
./data/ignoredBridgeSymbols.json
./data/symbolOverrides.json
./abi/SynapseRouter.json
./abi/SynapseCCTP.json
./abi/SynapseCCTPRouter.json
./abi/SwapQuoter.json
./abi/IERC20Metadata.json
./abi/IDefaultPool.json
Please verify if these files exist in the repository and update the import paths accordingly.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the imported files in the specified paths. # Test: Check if the files exist. Expect: All files should exist. for file in ./utils/prettyPrintTs ./utils/fetchRfqData ./data/providers.json ./data/ignoredBridgeSymbols.json ./data/symbolOverrides.json ./abi/SynapseRouter.json ./abi/SynapseCCTP.json ./abi/SynapseCCTPRouter.json ./abi/SwapQuoter.json ./abi/IERC20Metadata.json ./abi/IDefaultPool.json; do if [ ! -f "$file" ]; then echo "File not found: $file" fi doneLength of output: 4641
Script:
#!/bin/bash # Description: Search for the existence of the specified files in the repository. # List of files to search for files=( "prettyPrintTs" "fetchRfqData" "providers.json" "ignoredBridgeSymbols.json" "symbolOverrides.json" "SynapseRouter.json" "SynapseCCTP.json" "SynapseCCTPRouter.json" "SwapQuoter.json" "IERC20Metadata.json" "IDefaultPool.json" ) # Search for each file in the repository for file in "${files[@]}"; do echo "Searching for: $file" fd "$file" doneLength of output: 3062
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (2)
packages/synapse-constants/constants/assets/chains/linea.svg
is excluded by!**/*.svg
packages/synapse-constants/constants/assets/explorer/linea.svg
is excluded by!**/*.svg
Files selected for processing (22)
- packages/explorer-ui/components/ChainChart/index.tsx (1 hunks)
- packages/explorer-ui/graphql/queries/index.ts (1 hunks)
- packages/synapse-constants/constants/assets/chains/index.ts (1 hunks)
- packages/synapse-constants/constants/assets/explorer/index.ts (1 hunks)
- packages/synapse-constants/constants/bridgeMap.ts (38 hunks)
- packages/synapse-constants/constants/chains/index.ts (2 hunks)
- packages/synapse-constants/constants/chains/master.ts (3 hunks)
- packages/synapse-constants/constants/tokens/bridgeMap.ts (39 hunks)
- packages/synapse-constants/constants/tokens/bridgeable.ts (5 hunks)
- packages/synapse-constants/constants/tokens/deprecated.ts (1 hunks)
- packages/synapse-constants/constants/tokens/swapMaster.ts (1 hunks)
- packages/synapse-constants/scripts/generateMaps.js (9 hunks)
- packages/synapse-constants/scripts/utils/fetchRfqData.js (1 hunks)
- packages/synapse-constants/scripts/utils/prettyPrintTs.js (1 hunks)
- services/explorer/api/server_test.go (1 hunks)
- services/explorer/graphql/client/client.go (2 hunks)
- services/explorer/graphql/client/queries/queries.graphql (1 hunks)
- services/explorer/graphql/server/graph/model/models_gen.go (1 hunks)
- services/explorer/graphql/server/graph/partials.go (6 hunks)
- services/explorer/graphql/server/graph/resolver/server.go (6 hunks)
- services/explorer/graphql/server/graph/schema/types.graphql (1 hunks)
- services/explorer/static/chainIDs.yaml (1 hunks)
Files skipped from review due to trivial changes (5)
- packages/synapse-constants/constants/assets/chains/index.ts
- packages/synapse-constants/constants/assets/explorer/index.ts
- packages/synapse-constants/constants/tokens/deprecated.ts
- packages/synapse-constants/constants/tokens/swapMaster.ts
- services/explorer/static/chainIDs.yaml
Additional comments not posted (53)
packages/explorer-ui/graphql/queries/index.ts (1)
213-213
: LGTM! The addition of thelinea
field is correct.The
linea
field has been correctly added to theDAILY_STATISTICS_BY_CHAIN
query.services/explorer/graphql/server/graph/schema/types.graphql (1)
182-182
: Addition oflinea
field looks good.The new field
linea
is consistent with the existing fields in theDateResultByChain
type and is appropriately typed asFloat
.packages/synapse-constants/constants/chains/index.ts (2)
78-78
: Addition ofLINEA
entry inChainId
looks good.The new entry
LINEA
with the value59144
is consistent with the existing entries in theChainId
mapping.
128-130
: Additions toFASTBRIDGE_CONTRACTS
look good.The new entries for
ChainId.LINEA
,ChainId.BLAST
, andChainId.BSC
are consistent with the existing entries and the addresses are correctly formatted.services/explorer/api/server_test.go (1)
60-60
: Addition ofLinea
field in the test struct looks good.The new field
Linea
is consistent with the existing fields and is appropriately typed as a pointer tofloat64
with JSON and GraphQL tags for serialization.services/explorer/graphql/client/queries/queries.graphql (1)
157-157
: LGTM! Thelinea
field addition is correct.The addition of the
linea
field to theGetDailyStatisticsByChain
query is consistent with the existing fields and follows the correct pattern.packages/explorer-ui/components/ChainChart/index.tsx (1)
317-322
: LGTM! The<Bar>
component forlinea
is correctly added.The addition of the new
<Bar>
component for thelinea
data series is consistent with the existing<Bar>
components and follows the correct pattern.packages/synapse-constants/constants/chains/master.ts (3)
22-22
: LGTM! The import statement forlineaImg
is correct.The import statement for the
lineaImg
asset is correctly added.
44-44
: LGTM! The import statement forlineaExplorerImg
is correct.The import statement for the
lineaExplorerImg
asset is correctly added.
484-506
: LGTM! TheLINEA
entity is correctly added.The addition of the
LINEA
entity is comprehensive and follows the same pattern as the other blockchain entities. It includes all necessary properties.packages/synapse-constants/scripts/generateMaps.js (4)
33-37
: Verify the correctness and usage of new constants.The new constants
allowedChainIdsForSynapseBridge
andallowedChainIdsForRfq
have been introduced. Ensure that these constants are correctly defined and used appropriately in the code.Also applies to: 42-43
Verification successful
The new constants are correctly defined and used appropriately in the codebase.
The constants
allowedChainIdsForSynapseBridge
andallowedChainIdsForRfq
are defined and used consistently in bothpackages/synapse-constants/scripts/generateMaps.js
andpackages/synapse-interface/scripts/generateMaps.js
.
allowedChainIdsForSynapseBridge
is used inforEach
loops.allowedChainIdsForRfq
is used inincludes
checks.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new constants in the codebase. # Test: Search for the usage of the constants. Expect: Constants should be used in appropriate places. rg --type js 'allowedChainIdsForSynapseBridge' rg --type js 'allowedChainIdsForRfq'Length of output: 1167
462-463
: Ensure correctness of the new function logic.The function
getRFQSymbol
has been introduced to generate RFQ symbols. Ensure that the function logic is correct and follows best practices.Verification successful
Ensure correctness of the new function logic.
The function
getRFQSymbol
has been introduced to generate RFQ symbols by concatenating "RFQ." with the provided symbol. The logic is straightforward and appears to be correctly implemented in bothpackages/synapse-constants/scripts/generateMaps.js
andpackages/synapse-interface/scripts/generateMaps.js
.
packages/synapse-constants/scripts/generateMaps.js
packages/synapse-interface/scripts/generateMaps.js
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new function logic in the `getRFQSymbol` function. # Test: Search for the function definition and its usage. Expect: Function logic should be correctly implemented. rg --type js 'const getRFQSymbol' rg --type js 'getRFQSymbol'Length of output: 649
81-86
: Ensure correctness and performance of the updated function logic.The function
getBridgeOriginMap
has been updated to return early for chains without a correspondingSwapQuoter
. Ensure that this logic is correct and optimizes performance by preventing unnecessary processing.Verification successful
The early return logic in the
getBridgeOriginMap
function is correctly implemented and optimizes performance by preventing unnecessary processing.
- The function returns early if there is no
SwapQuoter
for the givenchainId
, ensuring efficient execution.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the early return logic in the `getBridgeOriginMap` function. # Test: Search for the function definition and its usage. Expect: Early return logic should be correctly implemented. rg --type js 'const getBridgeOriginMap' rg --type js 'getBridgeOriginMap'Length of output: 717
Script:
#!/bin/bash # Extract the full implementation of `getBridgeOriginMap` from both files. # Extract from packages/synapse-constants/scripts/generateMaps.js ast-grep --lang javascript --pattern $'const getBridgeOriginMap = async (chainId) => { $$$ }' packages/synapse-constants/scripts/generateMaps.js # Extract from packages/synapse-interface/scripts/generateMaps.js ast-grep --lang javascript --pattern $'const getBridgeOriginMap = async (chainId) => { $$$ }' packages/synapse-interface/scripts/generateMaps.jsLength of output: 12657
Line range hint
277-297
:
Ensure correctness and integration of new RFQ data handling logic.The function
printMaps
has been expanded to handle RFQ data. Ensure that the new logic is correct and integrates well with the existing code.Also applies to: 312-369
Verification successful
The new RFQ data handling logic in the
printMaps
function is correctly implemented and well-integrated with the existing code.
- The function correctly checks for allowed chain IDs and adds RFQ symbols to the origin and destination lists.
- The RFQ responses are processed and integrated into the existing token maps.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new RFQ data handling logic in the `printMaps` function. # Test: Search for the function definition and its usage. Expect: RFQ data handling logic should be correctly implemented. rg --type js 'const printMaps' rg --type js 'printMaps'Length of output: 515
Script:
#!/bin/bash # Extract the implementation of the `printMaps` function from both files for comparison and review. # Extract from `packages/synapse-constants/scripts/generateMaps.js` rg --type js -A 50 'const printMaps = async () => {' packages/synapse-constants/scripts/generateMaps.js # Extract from `packages/synapse-interface/scripts/generateMaps.js` rg --type js -A 50 'const printMaps = async () => {' packages/synapse-interface/scripts/generateMaps.jsLength of output: 463
Script:
#!/bin/bash # Extract the implementation of the `printMaps` function from both files for comparison and review. # Extract from `packages/synapse-constants/scripts/generateMaps.js` rg --type js -A 50 'const printMaps = async () =>' packages/synapse-constants/scripts/generateMaps.js # Extract from `packages/synapse-interface/scripts/generateMaps.js` rg --type js -A 50 'const printMaps = async () =>' packages/synapse-interface/scripts/generateMaps.jsLength of output: 207
Script:
#!/bin/bash # Extract the implementation of the `printMaps` function from both files for comparison and review. # Extract from `packages/synapse-constants/scripts/generateMaps.js` rg --type js -A 100 'printMaps' packages/synapse-constants/scripts/generateMaps.js # Extract from `packages/synapse-interface/scripts/generateMaps.js` rg --type js -A 100 'printMaps' packages/synapse-interface/scripts/generateMaps.jsLength of output: 7669
services/explorer/graphql/server/graph/model/models_gen.go (1)
106-106
: Ensure correctness and integration of the new field.The new field
Linea
has been added to theDateResultByChain
struct. Ensure that the field is correctly defined and integrates well with the existing code.Verification successful
Ensure the new field
Linea
is correctly integrated and used.The new field
Linea
has been added to theDateResultByChain
struct. We need to verify its usage and integration in the codebase.
The new field
Linea
is correctly defined and integrated.The field
Linea
has been added to theDateResultByChain
struct and is correctly utilized in the codebase, including JSON and GraphQL contexts, as well as in resolver logic.
services/explorer/graphql/client/client.go
services/explorer/graphql/server/graph/model/models_gen.go
services/explorer/graphql/server/graph/resolver/server.go
services/explorer/api/server_test.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new field in the `DateResultByChain` struct. # Test: Search for the struct definition and its usage. Expect: Field should be correctly implemented. rg --type go 'type DateResultByChain struct' rg --type go 'DateResultByChain'Length of output: 35107
Script:
#!/bin/bash # Description: Verify the usage of the new field `Linea` in the codebase. # Test: Search for the term `Linea` to check its usage. rg --type go 'Linea'Length of output: 735
services/explorer/graphql/client/client.go (2)
504-504
: Ensure correctness and integration of the query updates.The query
GetDailyStatisticsByChainDocument
has been updated to include thelinea
field. Ensure that the query updates are correctly defined and integrate well with the existing code.Verification successful
The
linea
field has been correctly defined and integrated into theGetDailyStatisticsByChainDocument
query and the rest of the codebase.
services/explorer/graphql/client/client.go
: Thelinea
field is defined and included in the query.services/explorer/graphql/server/graph/partials.go
: Thelinea
field is used in query results.services/explorer/graphql/server/graph/model/models_gen.go
: Thelinea
field is included in the model.services/explorer/graphql/server/graph/resolver/server.go
: Thelinea
field is handled in the resolver.services/explorer/api/server_test.go
: Thelinea
field is included in the tests.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the query updates in the `GetDailyStatisticsByChainDocument`. # Test: Search for the query definition and its usage. Expect: Query updates should be correctly implemented. rg --type go 'const GetDailyStatisticsByChainDocument' rg --type go 'GetDailyStatisticsByChainDocument'Length of output: 735
Script:
#!/bin/bash # Description: Verify the inclusion and usage of the `linea` field in the `GetDailyStatisticsByChainDocument` query. # Test: Search for the `linea` field within the `GetDailyStatisticsByChainDocument` query definition. rg --type go 'linea' services/explorer/graphql/client/client.go # Test: Search for the usage of the `linea` field in the codebase. rg --type go 'linea'Length of output: 2170
131-131
: Ensure correctness and integration of the new field.The new field
Linea
has been added to theGetDailyStatisticsByChain
struct. Ensure that the field is correctly defined and integrates well with the existing code.Verification successful
Ensure correctness and integration of the new field.
The new field
Linea
has been added to theGetDailyStatisticsByChain
struct. Ensure that the field is correctly defined and integrates well with the existing code.
- Verify the struct definition in
services/explorer/graphql/client/client.go
.- Check the usage instances in the same file and other files to confirm proper integration.
Ensure correctness and integration of the new field.
The new field
Linea
has been added to theGetDailyStatisticsByChain
struct. Ensure that the field is correctly defined and integrates well with the existing code.
- Verify the presence and correct definition of the
Linea
field in theGetDailyStatisticsByChain
struct.- Check the usage instances in the same file and other files to confirm proper integration.
Ensure correctness and integration of the new field.
The new field
Linea
has been correctly added to theGetDailyStatisticsByChain
struct and is integrated into the existing codebase.
- The
Linea
field is defined in theGetDailyStatisticsByChain
struct inservices/explorer/graphql/client/client.go
.- The
Linea
field is also referenced in test files and other related model and resolver files, indicating proper integration.The field
Linea
appears to be correctly implemented and integrated.
services/explorer/graphql/client/client.go
services/explorer/api/server_test.go
services/explorer/graphql/server/graph/model/models_gen.go
services/explorer/graphql/server/graph/resolver/server.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new field in the `GetDailyStatisticsByChain` struct. # Test: Search for the struct definition and its usage. Expect: Field should be correctly implemented. rg --type go 'type GetDailyStatisticsByChain struct' rg --type go 'GetDailyStatisticsByChain'Length of output: 8681
Script:
#!/bin/bash # Description: Verify the new field in the `GetDailyStatisticsByChain` struct. # Test: Search for the struct definition and its usage. Expect: Field should be correctly implemented. rg --type go 'type GetDailyStatisticsByChain struct' -A 10 rg --type go 'GetDailyStatisticsByChain' -A 10Length of output: 40315
Script:
#!/bin/bash # Description: Verify the new field in the `GetDailyStatisticsByChain` struct. # Test: Search for the specific field `Linea` in the struct definition. Expect: Field should be correctly implemented. rg --type go 'Linea' -A 5 -B 5Length of output: 6137
services/explorer/graphql/server/graph/partials.go (6)
403-403
: LGTM!The addition of the
linea
field to thedailyVolumeBridgeMvPt1
query is consistent with the existing fields.
447-447
: LGTM!The addition of the
linea
field to thedailyVolumeBridge
query is consistent with the existing fields.
543-543
: LGTM!The addition of the
linea
field to thedailyStatisticGenericSelect
query is consistent with the existing fields.
645-645
: LGTM!The addition of the
linea
field to thedailyStatisticGenericSinglePlatform
query is consistent with the existing fields.
676-676
: LGTM!The addition of the
linea
field to thedailyStatisticGenericSinglePlatformMv
query is consistent with the existing fields.
708-708
: LGTM!The addition of the
linea
field to thedailyStatisticGenericSinglePlatformMvFee
query is consistent with the existing fields.packages/synapse-constants/constants/tokens/bridgeable.ts (3)
415-415
: LGTM!The addition of the
LINEA
chain entry to theUSDC
token definition is consistent with the existing entries.
492-492
: LGTM!The addition of the
SCROLL
chain entry to theUSDT
token definition is consistent with the existing entries.
792-792
: LGTM!The addition of the
LINEA
chain entry to theETH
token definition is consistent with the existing entries.packages/synapse-constants/constants/bridgeMap.ts (10)
34-42
: Approved: Addition ofRFQ.USDC
tonUSD
origin array.The addition of
RFQ.USDC
to theorigin
array fornUSD
is consistent with the PR objective of integrating RFQ mechanisms.
71-79
: Approved: Addition ofRFQ.USDC
toLUSD
origin array.The addition of
RFQ.USDC
to theorigin
array forLUSD
is consistent with the PR objective of integrating RFQ mechanisms.
101-109
: Approved: Addition ofRFQ.USDC
toDAI
origin array.The addition of
RFQ.USDC
to theorigin
array forDAI
is consistent with the PR objective of integrating RFQ mechanisms.
124-132
: Approved: Addition ofRFQ.USDC
toPYUSD
origin array.The addition of
RFQ.USDC
to theorigin
array forPYUSD
is consistent with the PR objective of integrating RFQ mechanisms.
161-169
: Approved: Addition ofRFQ.USDC
toFRAX
origin array.The addition of
RFQ.USDC
to theorigin
array forFRAX
is consistent with the PR objective of integrating RFQ mechanisms.
191-200
: Approved: Addition ofRFQ.USDC
toUSDC
origin and destination arrays.The addition of
RFQ.USDC
to theorigin
anddestination
arrays forUSDC
is consistent with the PR objective of integrating RFQ mechanisms.
235-235
: Approved: Addition ofRFQ.ETH
toWETH
origin array.The addition of
RFQ.ETH
to theorigin
array forWETH
is consistent with the PR objective of integrating RFQ mechanisms.
242-243
: Approved: Addition ofRFQ.ETH
toETH
origin and destination arrays.The addition of
RFQ.ETH
to theorigin
anddestination
arrays forETH
is consistent with the PR objective of integrating RFQ mechanisms.
256-264
: Approved: Addition ofRFQ.USDC
toUSDT
origin array.The addition of
RFQ.USDC
to theorigin
array forUSDT
is consistent with the PR objective of integrating RFQ mechanisms.
311-312
: Approved: Addition ofRFQ.USDC
toUSDC
origin array on chain10
.The addition of
RFQ.USDC
to theorigin
array forUSDC
on chain10
is consistent with the PR objective of integrating RFQ mechanisms.packages/synapse-constants/constants/tokens/bridgeMap.ts (11)
34-42
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F
is a beneficial change.
71-79
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0x5f98805A4E8be255a32880FDeC7F6728C6568bA0
is a beneficial change.
101-109
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0x6B175474E89094C44Da98b954EedeAC495271d0F
is a beneficial change.
124-132
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0x6c3ea9036406852006290770BEdFcAbA0e23A0e8
is a beneficial change.
161-169
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0x853d955aCEf822Db058eb8505911ED77F175b99e
is a beneficial change.
191-200
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
anddestination
fields for the token0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
is a beneficial change.
256-264
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0xdAC17F958D2ee523a2206206994597C13D831ec7
is a beneficial change.
286-294
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E
is a beneficial change.
311-312
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
anddestination
fields for the token0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
is a beneficial change.
355-355
: LGTM! The inclusion ofRFQ.USDC
enhances liquidity and trading routes.The addition of
RFQ.USDC
to theorigin
field for the token0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00
is a beneficial change.
218-224
: LGTM! The addition of the new token entry is a beneficial enhancement.The new entry for the token
0xAdF7C35560035944e805D98fF17d58CDe2449389
withorigin
,destination
, andswappable
fields expands the bridge's capabilities.services/explorer/graphql/server/graph/resolver/server.go (6)
119-119
: LGTM!The addition of the
Linea
function to theComplexityRoot
struct is consistent with the existing fields.
607-613
: LGTM!The addition of the
linea
case in the complexity calculation logic is consistent with the existing cases.
1666-1666
: LGTM!The addition of the
linea
field to theDateResultByChain
struct is consistent with the existing fields.
4794-4833
: LGTM!The resolver function
_DateResultByChain_linea
and its field context management are consistent with the existing resolver functions and field context management.
7191-7192
: LGTM!The addition of the
linea
case in the field context management switch-case is consistent with the existing cases.
10435-10436
: LGTM!The addition of the
linea
case in the resolver switch-case is consistent with the existing cases.
Comments failed to post (3)
packages/synapse-constants/scripts/utils/fetchRfqData.js
4-14: Handle network issues more gracefully.
Consider retrying the fetch request a few times before failing.
const fetchRfqData = async (retries = 3) => { try { const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 5000); // 5 seconds timeout const response = await fetch(RFQ_URL, { signal: controller.signal }); clearTimeout(timeoutId); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } catch (error) { if (retries > 0) { console.warn(`Retrying... (${3 - retries + 1})`); return fetchRfqData(retries - 1); } else { console.error('Failed to fetch RFQ data:', error); return []; } } };
Consider adding a timeout to the fetch request.
Adding a timeout can help prevent the function from hanging indefinitely if the server does not respond.
+ const controller = new AbortController(); + const timeoutId = setTimeout(() => controller.abort(), 5000); // 5 seconds timeout const response = await fetch(RFQ_URL, { signal: controller.signal }); + clearTimeout(timeoutId);Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.const fetchRfqData = async () => { const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 5000); // 5 seconds timeout try { const response = await fetch(RFQ_URL, { signal: controller.signal }); clearTimeout(timeoutId); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } catch (error) { console.error('Failed to fetch RFQ data:', error); return []; } }
packages/synapse-constants/scripts/utils/prettyPrintTs.js
10-10: Add error handling for the Prettier execution step.
Consider wrapping the Prettier execution step in a try-catch block to handle potential errors.
- execSync(`npx prettier --write ${fn}`); + try { + execSync(`npx prettier --write ${fn}`); + } catch (error) { + console.error(`Failed to format file ${fn} with Prettier:`, error); + }Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.try { execSync(`npx prettier --write ${fn}`); } catch (error) { console.error(`Failed to format file ${fn} with Prettier:`, error); }
5-10: Add error handling for the file writing step.
Consider wrapping the file writing step in a try-catch block to handle potential errors.
const json = JSON.stringify(map); - fs.writeFileSync(fn, `export const ${mapName} = ${json}`); + try { + fs.writeFileSync(fn, `export const ${mapName} = ${json}`); + } catch (error) { + console.error(`Failed to write file ${fn}:`, error); + return; + }Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.const prettyPrintTS = (map, mapName, fn) => { console.log(`Writing ${mapName} to ${fn}`) const json = JSON.stringify(map) try { fs.writeFileSync(fn, `export const ${mapName} = ${json}`) } catch (error) { console.error(`Failed to write file ${fn}:`, error) return; } // Run prettier on the file using terminal command: execSync(`npx prettier --write ${fn}`)
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.
PR Summary
Updated Linea SVG and integrated it into the explorer UI, ensuring visibility and data representation.
- ChainChart Update: Added
Bar
element forlinea
inpackages/explorer-ui/components/ChainChart/index.tsx
with specific fill colors. - GraphQL Query Update: Included
linea
chain inDAILY_STATISTICS_BY_CHAIN
query inpackages/explorer-ui/graphql/queries/index.ts
. - SVG Export: Added
linea.svg
export inpackages/synapse-constants/constants/assets/chains/index.ts
. - Bridge Map Update: Added new origins and destinations for tokens in
packages/synapse-constants/constants/bridgeMap.ts
. - Chain Constants Update: Added Linea and Blast chains in
packages/synapse-constants/constants/chains/index.ts
.
28 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2928 +/- ##
===================================================
+ Coverage 25.69758% 25.70023% +0.00265%
===================================================
Files 771 770 -1
Lines 55585 55482 -103
Branches 80 80
===================================================
- Hits 14284 14259 -25
+ Misses 39821 39748 -73
+ Partials 1480 1475 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
PR Summary
(updates since last review)
Updated Linea SVG and integrated it into the explorer UI, ensuring visibility and data representation.
- Refactored
getTxAge
Function: Improved modularity and error handling incontrib/opbot/botmd/commands.go
. - New Test for
GetTxAge
: AddedTestTxAge
incontrib/opbot/botmd/commands_test.go
to validate transaction age calculation. - Metrics for Address Screening: Introduced new metrics in
contrib/screener-api/screener/screener.go
for better monitoring. - OpenTelemetry Integration: Enhanced
Guard
service withotelRecorder
inservices/rfq/guard/service/guard.go
andotel.go
. - Retry Mechanism for Withdrawals: Added retry logic in
services/rfq/relayer/cmd/commands.go
for fetching transaction hashes.
31 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Updates the linea svg so that it is visible in the explorer UI.
Summary by CodeRabbit
New Features
<Bar>
component in the ChainChart for enhanced visual representation.linea
field, providing more comprehensive data.LINEA
blockchain, including new tokens and constants for improved interoperability.Bug Fixes
Chores
linea
andscroll
.