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

Track used gas in channel and packet transactions #22

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

Inkvi
Copy link
Collaborator

@Inkvi Inkvi commented Aug 12, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a gasUsed property across various transaction-related models and handlers for improved tracking of gas consumption.
    • Enhanced GraphQL schema with additional gasUsed fields for key entities, allowing for better gas usage reporting.
  • Bug Fixes

    • Addressed potential issues in transaction handling by ensuring the inclusion of gas usage data in packet and channel events.
  • Documentation

    • Updated relevant documentation to reflect changes in transaction handling and database schema updates regarding gas usage.

@Inkvi Inkvi requested review from dshiell and mvpoyatt August 12, 2024 23:10
Copy link

coderabbitai bot commented Aug 12, 2024

Walkthrough

The recent changes introduce a gasUsed property across multiple components of the system, enhancing tracking of gas consumption related to blockchain transactions. Updates include new columns in database migrations, revisions to GraphQL schemas, and modifications in TypeScript models. Functions managing channel and packet events now incorporate this metric, allowing for improved insights into performance and cost calculations.

Changes

File Path Change Summary
db/migrations/.../Data.js Added gas_used column to various tables with migration methods for addition and removal.
schema.graphql Introduced gasUsed field of type BigInt to multiple entity types for gas tracking.
src/handlers/channels.ts Updated functions to include gasUsed in objects constructed during channel handling.
src/handlers/packets.ts Enhanced packet handling functions with gasUsed for tracking gas consumption.
src/model/generated/.../*.model.ts Added gasUsed property (nullable bigint) to various model classes for better data representation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChannelHandler
    participant PacketHandler
    participant Database
    participant GraphQLAPI

    User->>ChannelHandler: Initiate Channel Transaction
    ChannelHandler->>Database: Add gasUsed to transaction
    ChannelHandler->>GraphQLAPI: Send channel data with gasUsed
    GraphQLAPI-->>User: Return transaction details with gasUsed

    User->>PacketHandler: Send Packet Transaction
    PacketHandler->>Database: Log packet with gasUsed
    PacketHandler->>GraphQLAPI: Send packet data with gasUsed
    GraphQLAPI-->>User: Return packet details with gasUsed
Loading

Poem

🐇 In the meadow where bunnies hop,
New gas metrics make our hearts stop!
With every packet and channel in sight,
We track our usage, oh what a delight!
Hopping along, our data will bloom,
Celebrating changes that brighten the room! 🌼


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 7243809 and 8c6a1b9.

Files selected for processing (15)
  • db/migrations/1723504100232-Data.js (1 hunks)
  • schema.graphql (11 hunks)
  • src/handlers/channels.ts (4 hunks)
  • src/handlers/packets.ts (12 hunks)
  • src/model/generated/acknowledgement.model.ts (1 hunks)
  • src/model/generated/channelOpenAck.model.ts (1 hunks)
  • src/model/generated/channelOpenConfirm.model.ts (1 hunks)
  • src/model/generated/channelOpenInit.model.ts (1 hunks)
  • src/model/generated/channelOpenTry.model.ts (1 hunks)
  • src/model/generated/closeIbcChannel.model.ts (1 hunks)
  • src/model/generated/recvPacket.model.ts (1 hunks)
  • src/model/generated/sendPacket.model.ts (1 hunks)
  • src/model/generated/timeout.model.ts (1 hunks)
  • src/model/generated/writeAckPacket.model.ts (1 hunks)
  • src/model/generated/writeTimeoutPacket.model.ts (1 hunks)
Additional comments not posted (33)
src/model/generated/timeout.model.ts (1)

48-49: Addition of gasUsed property for enhanced gas tracking.

The gasUsed property has been correctly added to the Timeout class to track gas consumption. Its nullable nature allows for flexibility in scenarios where gas usage might not be recorded.

src/model/generated/acknowledgement.model.ts (1)

49-50: Addition of gasUsed property for enhanced gas tracking.

The gasUsed property has been correctly added to the Acknowledgement class to track gas consumption. Its nullable nature allows for flexibility in scenarios where gas usage might not be recorded.

src/model/generated/recvPacket.model.ts (1)

51-52: Addition of gasUsed property for enhanced gas tracking.

The gasUsed property has been correctly added to the RecvPacket class to track gas consumption. Its nullable nature allows for flexibility in scenarios where gas usage might not be recorded.

src/model/generated/writeTimeoutPacket.model.ts (1)

57-58: Addition of gasUsed property is appropriate.

The gasUsed property is a valuable addition for tracking transaction metrics and is correctly defined as a nullable bigint, consistent with other gas-related properties.

src/model/generated/closeIbcChannel.model.ts (1)

48-49: Addition of gasUsed property is appropriate.

The gasUsed property is a valuable addition for tracking transaction metrics and is correctly defined as a nullable bigint, consistent with other gas-related properties.

src/model/generated/channelOpenAck.model.ts (1)

54-55: Addition of gasUsed property is appropriate.

The gasUsed property is a valuable addition for tracking transaction metrics and is correctly defined as a nullable bigint, consistent with other gas-related properties.

src/model/generated/channelOpenConfirm.model.ts (1)

54-55: Addition of gasUsed property looks good.

The gasUsed property has been added correctly and is consistent with the existing properties. Ensure that any logic interacting with this class accommodates the new property.

db/migrations/1723504100232-Data.js (1)

1-30: Migration file is well-structured.

The migration file correctly adds and removes the gas_used column across various tables. Ensure that this migration is tested in all environments to confirm its execution without issues.

src/model/generated/writeAckPacket.model.ts (1)

55-56: Addition of gasUsed property looks good.

The gasUsed property has been added correctly and is consistent with the existing properties. Ensure that any logic interacting with this class accommodates the new property.

src/model/generated/channelOpenTry.model.ts (1)

66-67: Addition of gasUsed property is appropriate.

The gasUsed property is correctly added as a bigint type and is nullable, which aligns with the objective of tracking gas usage. This change is consistent with the existing pattern in the class.

src/model/generated/channelOpenInit.model.ts (1)

70-71: Addition of gasUsed property is appropriate.

The gasUsed property is correctly added as a bigint type and is nullable, which aligns with the objective of tracking gas usage. This change is consistent with the existing pattern in the class.

src/model/generated/sendPacket.model.ts (1)

73-74: Addition of gasUsed property is appropriate.

The gasUsed property is correctly added as a bigint type and is nullable, which aligns with the objective of tracking gas usage. This change is consistent with the existing pattern in the class.

schema.graphql (11)

47-47: Addition of gasUsed field to SendPacket entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


73-73: Addition of gasUsed field to RecvPacket entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


96-96: Addition of gasUsed field to WriteAckPacket entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


120-120: Addition of gasUsed field to Acknowledgement entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


141-141: Addition of gasUsed field to Timeout entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


164-164: Addition of gasUsed field to WriteTimeoutPacket entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


233-233: Addition of gasUsed field to ChannelOpenInit entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


263-263: Addition of gasUsed field to ChannelOpenTry entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


287-287: Addition of gasUsed field to ChannelOpenAck entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


312-312: Addition of gasUsed field to ChannelOpenConfirm entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.


335-335: Addition of gasUsed field to CloseIbcChannel entity.

The gasUsed field has been correctly added as a BigInt. Ensure that this field is populated correctly in the application logic.

src/handlers/packets.ts (6)

Line range hint 19-42:
Addition of gasUsed in handleSendPacket.

The gasUsed variable is correctly added and integrated into the SendPacket model. Ensure that this value is accurately derived from the transaction log.


Line range hint 54-72:
Addition of gasUsed in handleRecvPacket.

The gasUsed variable is correctly added and integrated into the RecvPacket model. Ensure that this value is accurately derived from the transaction log.


Line range hint 85-105:
Addition of gasUsed in handleWriteAckPacket.

The gasUsed variable is correctly added and integrated into the WriteAckPacket model. Ensure that this value is accurately derived from the transaction log.


Line range hint 116-134:
Addition of gasUsed in handleAcknowledgement.

The gasUsed variable is correctly added and integrated into the Acknowledgement model. Ensure that this value is accurately derived from the transaction log.


Line range hint 146-164:
Addition of gasUsed in handleTimeout.

The gasUsed variable is correctly added and integrated into the Timeout model. Ensure that this value is accurately derived from the transaction log.


Line range hint 176-197:
Addition of gasUsed in handleWriteTimeoutPacket.

The gasUsed variable is correctly added and integrated into the WriteTimeoutPacket model. Ensure that this value is accurately derived from the transaction log.

src/handlers/channels.ts (4)

45-45: Addition of gasUsed in handleChannelOpenInit.

The gasUsed property is correctly added and integrated into the ChannelOpenInit model. Ensure that this value is accurately derived from the transaction log.


78-78: Addition of gasUsed in handleChannelOpenTry.

The gasUsed property is correctly added and integrated into the ChannelOpenTry model. Ensure that this value is accurately derived from the transaction log.


106-106: Addition of gasUsed in handleChannelOpenAck.

The gasUsed property is correctly added and integrated into the ChannelOpenAck model. Ensure that this value is accurately derived from the transaction log.


133-133: Addition of gasUsed in handleChannelOpenConfirm.

The gasUsed property is correctly added and integrated into the ChannelOpenConfirm model. Ensure that this value is accurately derived from the transaction log.

Copy link
Member

@dshiell dshiell left a comment

Choose a reason for hiding this comment

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

lgtm, will this trigger backfilling, or only affect moving forward unless we start a backfill explicitly?

@Inkvi Inkvi force-pushed the inkvi/track-gas-used branch from 8c6a1b9 to f6e7018 Compare August 23, 2024 04:34
Copy link

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 8c6a1b9 and f6e7018.

Files selected for processing (15)
  • db/migrations/1723504100232-Data.js (1 hunks)
  • schema.graphql (11 hunks)
  • src/handlers/channels.ts (4 hunks)
  • src/handlers/packets.ts (12 hunks)
  • src/model/generated/acknowledgement.model.ts (1 hunks)
  • src/model/generated/channelOpenAck.model.ts (1 hunks)
  • src/model/generated/channelOpenConfirm.model.ts (1 hunks)
  • src/model/generated/channelOpenInit.model.ts (1 hunks)
  • src/model/generated/channelOpenTry.model.ts (1 hunks)
  • src/model/generated/closeIbcChannel.model.ts (1 hunks)
  • src/model/generated/recvPacket.model.ts (1 hunks)
  • src/model/generated/sendPacket.model.ts (1 hunks)
  • src/model/generated/timeout.model.ts (1 hunks)
  • src/model/generated/writeAckPacket.model.ts (1 hunks)
  • src/model/generated/writeTimeoutPacket.model.ts (1 hunks)
Additional comments not posted (15)
src/model/generated/timeout.model.ts (1)

48-49: Addition of gasUsed property is appropriate.

The gasUsed property is correctly added as a nullable bigint, aligning with the existing structure and enhancing the model's capability to track gas usage.

src/model/generated/acknowledgement.model.ts (1)

49-50: Addition of gasUsed property is appropriate.

The gasUsed property is correctly added as a nullable bigint, aligning with the existing structure and enhancing the model's capability to track gas usage.

src/model/generated/recvPacket.model.ts (1)

51-52: Addition of gasUsed property is appropriate.

The gasUsed property is correctly added as a nullable bigint, aligning with the existing structure and enhancing the model's capability to track gas usage.

src/model/generated/writeTimeoutPacket.model.ts (1)

57-58: Addition of gasUsed property is appropriate.

The gasUsed property has been correctly added as a nullable bigint, aligning with the objective to track gas usage in transactions. This enhances the data model's capability to represent gas consumption accurately.

src/model/generated/closeIbcChannel.model.ts (1)

48-49: Addition of gasUsed property is appropriate.

The gasUsed property has been correctly added as a nullable bigint, aligning with the objective to track gas usage in channel closure transactions. This enhances the data model's capability to represent gas consumption accurately.

src/model/generated/channelOpenAck.model.ts (1)

54-55: Addition of gasUsed property is appropriate.

The gasUsed property has been correctly added as a nullable bigint, aligning with the objective to track gas usage in channel opening acknowledgment transactions. This enhances the data model's capability to represent gas consumption accurately.

src/model/generated/channelOpenConfirm.model.ts (1)

54-55: Addition of gasUsed property is appropriate.

The addition of the gasUsed property enhances the data model by allowing it to track gas usage, aligning with the PR objectives.

db/migrations/1723504100232-Data.js (1)

1-30: Migration script correctly adds gas_used columns.

The migration script appropriately adds the gas_used column to multiple tables and provides a down method to remove it, ensuring database schema consistency.

src/model/generated/writeAckPacket.model.ts (1)

55-56: Addition of gasUsed property is appropriate.

The addition of the gasUsed property enhances the data model by allowing it to track gas usage, aligning with the PR objectives.

src/model/generated/channelOpenTry.model.ts (1)

66-67: Addition of gasUsed property is appropriate.

The gasUsed property is a valuable addition for tracking gas usage in transactions. Its nullable nature allows for flexibility in scenarios where gas usage data may not be available.

src/model/generated/channelOpenInit.model.ts (1)

70-71: Addition of gasUsed property is appropriate.

The gasUsed property is a valuable addition for tracking gas usage in transactions. Its nullable nature allows for flexibility in scenarios where gas usage data may not be available.

src/model/generated/sendPacket.model.ts (1)

73-74: Addition of gasUsed property is appropriate.

The gasUsed property is a valuable addition for tracking gas usage in transactions. Its nullable nature allows for flexibility in scenarios where gas usage data may not be available.

schema.graphql (1)

47-47: LGTM! Consistent addition of gasUsed field.

The addition of the gasUsed field across multiple entities is consistent and aligns with the PR objectives of tracking gas consumption. The use of BigInt is appropriate for handling large numerical values.

Also applies to: 76-76, 99-99, 123-123, 144-144, 167-167, 236-236, 266-266, 290-290, 315-315, 338-338

src/handlers/packets.ts (1)

19-19: LGTM! Consistent addition of gasUsed variable.

The addition of the gasUsed variable across multiple functions enhances the tracking of gas consumption in packet transactions. The changes are consistent and align with the PR objectives.

Also applies to: 42-42, 56-56, 74-74, 87-87, 107-107, 118-118, 136-136, 148-148, 166-166, 178-178, 199-199

src/handlers/channels.ts (1)

45-45: LGTM! Consistent addition of gasUsed property.

The addition of the gasUsed property in channel operation functions provides more detailed transaction data. The changes are consistent and align with the PR objectives.

Also applies to: 78-78, 106-106, 133-133

@Inkvi Inkvi force-pushed the inkvi/track-gas-used branch from f6e7018 to 45aaef1 Compare August 23, 2024 16:37
Copy link

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between f6e7018 and 45aaef1.

Files selected for processing (15)
  • db/migrations/1724431013276-Data.js (1 hunks)
  • schema.graphql (11 hunks)
  • src/handlers/channels.ts (4 hunks)
  • src/handlers/packets.ts (12 hunks)
  • src/model/generated/acknowledgement.model.ts (1 hunks)
  • src/model/generated/channelOpenAck.model.ts (1 hunks)
  • src/model/generated/channelOpenConfirm.model.ts (1 hunks)
  • src/model/generated/channelOpenInit.model.ts (1 hunks)
  • src/model/generated/channelOpenTry.model.ts (1 hunks)
  • src/model/generated/closeIbcChannel.model.ts (1 hunks)
  • src/model/generated/recvPacket.model.ts (1 hunks)
  • src/model/generated/sendPacket.model.ts (1 hunks)
  • src/model/generated/timeout.model.ts (1 hunks)
  • src/model/generated/writeAckPacket.model.ts (1 hunks)
  • src/model/generated/writeTimeoutPacket.model.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/model/generated/channelOpenAck.model.ts
  • src/model/generated/writeAckPacket.model.ts
Files skipped from review as they are similar to previous changes (12)
  • schema.graphql
  • src/handlers/channels.ts
  • src/handlers/packets.ts
  • src/model/generated/acknowledgement.model.ts
  • src/model/generated/channelOpenConfirm.model.ts
  • src/model/generated/channelOpenInit.model.ts
  • src/model/generated/channelOpenTry.model.ts
  • src/model/generated/closeIbcChannel.model.ts
  • src/model/generated/recvPacket.model.ts
  • src/model/generated/sendPacket.model.ts
  • src/model/generated/timeout.model.ts
  • src/model/generated/writeTimeoutPacket.model.ts
Additional comments not posted (7)
db/migrations/1724431013276-Data.js (7)

4-9: Ensure the indexes being dropped are no longer needed.

Dropping indexes can impact query performance. Verify that these indexes are no longer required or have been replaced by more efficient ones.


10-13: Confirm the impact of dropping columns.

Dropping columns like recv_gas_limit and recv_gas_price might affect existing functionality. Ensure that these columns are truly obsolete and that any dependent code is updated.


14-25: Adding gas_used column to multiple tables.

The addition of the gas_used column is consistent with the PR's objective to track gas usage. Ensure that the application logic is updated to populate these fields correctly.


19-20: Ensure NOT NULL constraints are appropriate.

The send_gas_limit and send_gas_price columns are added with NOT NULL constraints. Verify that there is no scenario where these values could be absent.


27-28: Dropping foreign key and unique constraints.

Ensure that dropping these constraints from send_packet_fee_deposited does not lead to data integrity issues.


29-32: Recreate indexes and constraints.

The new indexes and foreign key constraints seem to replace the old ones. Confirm that these changes align with the updated data model and query patterns.


35-64: Verify the down method accurately reverts changes.

The down method should precisely reverse the up method's operations. Ensure that all changes, including constraints and indexes, are correctly reverted.

@Inkvi Inkvi force-pushed the inkvi/track-gas-used branch from 45aaef1 to 79f65aa Compare August 23, 2024 17:15
Copy link

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 45aaef1 and 79f65aa.

Files selected for processing (15)
  • db/migrations/1724433295363-Data.js (1 hunks)
  • schema.graphql (11 hunks)
  • src/handlers/channels.ts (4 hunks)
  • src/handlers/packets.ts (12 hunks)
  • src/model/generated/acknowledgement.model.ts (1 hunks)
  • src/model/generated/channelOpenAck.model.ts (1 hunks)
  • src/model/generated/channelOpenConfirm.model.ts (1 hunks)
  • src/model/generated/channelOpenInit.model.ts (1 hunks)
  • src/model/generated/channelOpenTry.model.ts (1 hunks)
  • src/model/generated/closeIbcChannel.model.ts (1 hunks)
  • src/model/generated/recvPacket.model.ts (1 hunks)
  • src/model/generated/sendPacket.model.ts (1 hunks)
  • src/model/generated/timeout.model.ts (1 hunks)
  • src/model/generated/writeAckPacket.model.ts (1 hunks)
  • src/model/generated/writeTimeoutPacket.model.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/model/generated/sendPacket.model.ts
Files skipped from review as they are similar to previous changes (12)
  • schema.graphql
  • src/handlers/channels.ts
  • src/handlers/packets.ts
  • src/model/generated/acknowledgement.model.ts
  • src/model/generated/channelOpenAck.model.ts
  • src/model/generated/channelOpenInit.model.ts
  • src/model/generated/channelOpenTry.model.ts
  • src/model/generated/closeIbcChannel.model.ts
  • src/model/generated/recvPacket.model.ts
  • src/model/generated/timeout.model.ts
  • src/model/generated/writeAckPacket.model.ts
  • src/model/generated/writeTimeoutPacket.model.ts
Additional comments not posted (2)
src/model/generated/channelOpenConfirm.model.ts (1)

54-55: Addition of gasUsed property is appropriate.

The introduction of the gasUsed property aligns with the objective to track gas consumption. The use of @BigIntColumn_({nullable: true}) is suitable for handling cases where gas usage data might not be available.

db/migrations/1724433295363-Data.js (1)

1-42: Migration script is well-structured and aligns with objectives.

The migration script effectively modifies the database schema to support gas tracking, with clear up and down methods for applying and reverting changes. This aligns with the PR objectives.

@Inkvi Inkvi force-pushed the inkvi/track-gas-used branch from 79f65aa to ae50161 Compare August 23, 2024 17:27
Copy link

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 79f65aa and ae50161.

Files selected for processing (15)
  • db/migrations/1724433908520-Data.js (1 hunks)
  • schema.graphql (11 hunks)
  • src/handlers/channels.ts (4 hunks)
  • src/handlers/packets.ts (12 hunks)
  • src/model/generated/acknowledgement.model.ts (1 hunks)
  • src/model/generated/channelOpenAck.model.ts (1 hunks)
  • src/model/generated/channelOpenConfirm.model.ts (1 hunks)
  • src/model/generated/channelOpenInit.model.ts (1 hunks)
  • src/model/generated/channelOpenTry.model.ts (1 hunks)
  • src/model/generated/closeIbcChannel.model.ts (1 hunks)
  • src/model/generated/recvPacket.model.ts (1 hunks)
  • src/model/generated/sendPacket.model.ts (1 hunks)
  • src/model/generated/timeout.model.ts (1 hunks)
  • src/model/generated/writeAckPacket.model.ts (1 hunks)
  • src/model/generated/writeTimeoutPacket.model.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/model/generated/channelOpenAck.model.ts
  • src/model/generated/channelOpenInit.model.ts
Files skipped from review as they are similar to previous changes (10)
  • schema.graphql
  • src/handlers/channels.ts
  • src/handlers/packets.ts
  • src/model/generated/acknowledgement.model.ts
  • src/model/generated/channelOpenTry.model.ts
  • src/model/generated/closeIbcChannel.model.ts
  • src/model/generated/recvPacket.model.ts
  • src/model/generated/timeout.model.ts
  • src/model/generated/writeAckPacket.model.ts
  • src/model/generated/writeTimeoutPacket.model.ts
Additional comments not posted (3)
src/model/generated/channelOpenConfirm.model.ts (1)

54-55: Addition of gasUsed property is appropriate.

The inclusion of the gasUsed property in the ChannelOpenConfirm class aligns well with the objective of tracking gas usage. The use of nullable: true is appropriate for cases where gas usage data might not be available.

db/migrations/1724433908520-Data.js (1)

1-30: Migration script correctly adds gas_used column.

The migration script effectively adds the gas_used column to various tables, ensuring consistent tracking of gas usage. The down method appropriately handles the removal of these columns, making the migration reversible.

src/model/generated/sendPacket.model.ts (1)

73-74: Addition of gasUsed property is appropriate.

The inclusion of the gasUsed property in the SendPacket class aligns well with the objective of tracking gas usage. The use of nullable: true is appropriate for cases where gas usage data might not be available.

@Inkvi Inkvi merged commit eb56404 into main Aug 23, 2024
4 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Sep 17, 2024
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.

2 participants