-
Notifications
You must be signed in to change notification settings - Fork 6
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
Enable fee indexing and fix some issues #15
Conversation
WalkthroughThe recent updates enhance event handling capabilities and contract management within the blockchain application. Key changes include indexing parameters in the Changes
Poem
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 (
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
src/chains/base.ts (1)
12-12
: Ensureprocess.env.FEE_VAULT_BASE
is set.The environment variable
FEE_VAULT_BASE
is not set in any configuration files within the repository. Please ensure that this variable is properly set in all relevant environments to avoid runtime errors.
src/chains/base.ts
: Line 12Analysis chain
Ensure
process.env.FEE_VAULT_BASE
is set.The addition of
process.env.FEE_VAULT_BASE!
to theCONTRACTS
array is correct. However, ensure that this environment variable is properly set in all relevant environments to avoid runtime errors.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if `process.env.FEE_VAULT_BASE` is set in the environment configuration files. # Test: Search for the environment variable definition. Expect: The variable is set. rg --type env 'FEE_VAULT_BASE'Length of output: 58
Script:
#!/bin/bash # Description: Verify if `process.env.FEE_VAULT_BASE` is set in common environment configuration files. # Test: Search for the environment variable definition. Expect: The variable is set. rg 'FEE_VAULT_BASE' .env .env.* config/*.envLength of output: 104
Script:
#!/bin/bash # Description: Verify if `process.env.FEE_VAULT_BASE` is set in any file within the repository. # Test: Search for the environment variable definition. Expect: The variable is set. rg 'FEE_VAULT_BASE'Length of output: 68
src/chains/optimism.ts (1)
12-12
: Ensureprocess.env.FEE_VAULT_OPTIMISM
is set.The environment variable
process.env.FEE_VAULT_OPTIMISM
is not found in any configuration files. Ensure that this variable is properly set in all relevant environments to avoid runtime errors.
src/chains/optimism.ts
Analysis chain
Ensure
process.env.FEE_VAULT_OPTIMISM
is set.The addition of
process.env.FEE_VAULT_OPTIMISM!
to theCONTRACTS
array is correct. However, ensure that this environment variable is properly set in all relevant environments to avoid runtime errors.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if `process.env.FEE_VAULT_OPTIMISM` is set in the environment configuration files. # Test: Search for the environment variable definition. Expect: The variable is set. rg --type env 'FEE_VAULT_OPTIMISM'Length of output: 62
Script:
#!/bin/bash # Description: Verify if `process.env.FEE_VAULT_OPTIMISM` is set in any configuration files. # Test: Search for the environment variable definition across all files. Expect: The variable is set. rg 'FEE_VAULT_OPTIMISM'Length of output: 80
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- src/abi/fee.ts (1 hunks)
- src/chains/base.ts (1 hunks)
- src/chains/optimism.ts (1 hunks)
- src/handlers/fees.ts (2 hunks)
- src/handlers/index.ts (3 hunks)
Additional comments not posted (4)
src/handlers/fees.ts (2)
11-11
: LGTM!The addition of
id: log.id
to the returned object inhandleSendPacketFee
is correct and enhances the data structure.
27-27
: LGTM!The addition of
id: log.id
to the returned object inhandleOpenChannelFee
is correct and enhances the data structure.src/abi/fee.ts (1)
8-8
: LGTM! Indexing event parameters.The changes to index the
channelId
andsequence
parameters in theSendPacketFeeDeposited
event will improve the efficiency of querying event logs.src/handlers/index.ts (1)
119-164
: LGTM! Consolidated event handling logic.The consolidation of event handling logic reduces code duplication and enhances readability. Fetching the
portPrefix
only once per event improves performance.However, ensure that the changes do not introduce any breaking changes or missed event handling cases.
Verification successful
LGTM! Consolidated event handling logic.
The consolidation of event handling logic reduces code duplication and enhances readability. Fetching the
portPrefix
only once per event improves performance.
- The event handling functions are correctly defined and utilized.
- No missing event handling cases or breaking changes were found.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the consolidated event handling logic does not introduce any breaking changes. # Test: Search for the event handling functions. Expect: Only occurances of the new consolidated logic. rg --type typescript -A 5 $'handleSendPacket|handleRecvPacket|handleWriteAckPacket|handleAcknowledgement|handleTimeout|handleWriteTimeoutPacket|handleChannelOpenInit|handleChannelOpenTry|handleChannelOpenAck|handleChannelOpenConfirm'Length of output: 269
Script:
#!/bin/bash # Description: Verify that the consolidated event handling logic does not introduce any breaking changes. # Test: Search for the event handling functions. Expect: Only occurrences of the new consolidated logic. rg --type-add 'ts:*.ts' -t ts -A 5 'handleSendPacket|handleRecvPacket|handleWriteAckPacket|handleAcknowledgement|handleTimeout|handleWriteTimeoutPacket|handleChannelOpenInit|handleChannelOpenTry|handleChannelOpenAck|handleChannelOpenConfirm'Length of output: 10197
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- schema.graphql (1 hunks)
- src/handlers/fees.ts (2 hunks)
- src/model/generated/sendPacketFeeDeposited.model.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/handlers/fees.ts
Additional comments not posted (8)
src/model/generated/sendPacketFeeDeposited.model.ts (4)
20-21
: LGTM! ThesendGasLimit
property is appropriately defined.The use of
bigint
for gas-related attributes is suitable for handling large numerical values.
23-24
: LGTM! ThesendGasPrice
property is appropriately defined.The use of
bigint
for gas-related attributes is suitable for handling large numerical values.
26-27
: LGTM! TheackGasLimit
property is appropriately defined.The use of
bigint
for gas-related attributes is suitable for handling large numerical values.
29-30
: LGTM! TheackGasPrice
property is appropriately defined.The use of
bigint
for gas-related attributes is suitable for handling large numerical values.schema.graphql (4)
351-351
: LGTM! ThesendGasLimit
field is appropriately defined.The use of
BigInt!
ensures that the gas limit is required and appropriately handles large numerical values.
352-352
: LGTM! ThesendGasPrice
field is appropriately defined.The use of
BigInt!
ensures that the gas price is required and appropriately handles large numerical values.
353-353
: LGTM! TheackGasLimit
field is appropriately defined.The use of
BigInt!
ensures that the gas limit is required and appropriately handles large numerical values.
354-354
: LGTM! TheackGasPrice
field is appropriately defined.The use of
BigInt!
ensures that the gas price is required and appropriately handles large numerical values.
b4658c6
to
9b9aaed
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- db/migrations/1721827264108-Data.js (1 hunks)
- schema.graphql (1 hunks)
- src/handlers/fees.ts (2 hunks)
- src/model/generated/sendPacketFeeDeposited.model.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- schema.graphql
- src/handlers/fees.ts
- src/model/generated/sendPacketFeeDeposited.model.ts
Additional comments not posted (2)
db/migrations/1721827264108-Data.js (2)
4-10
: Ensure the correctness of SQL queries and data types.The SQL queries appear correct, but verify that the new columns (
send_gas_limit
,send_gas_price
,ack_gas_limit
,ack_gas_price
) are intended to benumeric
andNOT NULL
. Ensure this aligns with the database schema requirements.
13-19
: Ensure the correctness of SQL queries and data types.The SQL queries appear correct, but verify that the reverted columns (
gas_limits
,gas_prices
) are intended to beinteger array
andNOT NULL
. Ensure this aligns with the database schema requirements.
Summary by CodeRabbit
New Features
SendPacketFeeDeposited
event.Bug Fixes