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

feat(x/warden): remove SignTransactionRequests #173

Merged
merged 9 commits into from
Apr 16, 2024
Merged

Conversation

Pitasi
Copy link
Contributor

@Pitasi Pitasi commented Apr 15, 2024

I removed SignTransactionRequests and kept SignatureRequests only.

SignTransactionRequests consisted in a step that parsed the input binary as a L1 transaction and generated a corresponding SignatureRequest.

I simplified this by adding a "SignMethod" field to NewSignatureRequest, so that the user can specify directly how the input should be treated. A SignMethod called "black box" can be used when the input should be used as-is.

This has several benefits, for example we don't store anymore the entire L1 unsigned transactions in the app.db, saving some space. And it also reduces and clarifies our exposed APIs.

I fixed SpaceWard to use the new methods and types, and I started using our new wardjs client instead of ts-client. While doing that I found some little TypeScript/codegen problems with Telescope that I fixed in this PR.

Summary by CodeRabbit

  • New Features

    • Added support for multiple address types including Ethereum and Osmosis.
    • Introduced new functionalities in the app to accommodate changes in wallet addresses and types.
    • Enhanced asset management components for better performance and usability.
    • Updated signature request functionalities to a new mechanism.
  • Bug Fixes

    • Adjusted type handling in various components to improve reliability and type safety.
  • Refactor

    • Significant refactoring in components and hooks to align with updated backend changes and data structures.
    • Streamlined client management and query structures for enhanced performance.
  • Documentation

    • Updated inline comments and documentation to reflect new logic and functionalities.
  • Dependencies

    • Added new dependencies to support updated functionalities and improved existing package versions for better compatibility and performance.

This comment has been minimized.

Copy link
Contributor

coderabbitai bot commented Apr 15, 2024

Walkthrough

Walkthrough

The changes represent a strategic pivot towards address management over transaction signing. This transition involves eliminating transaction signing capabilities, introducing new address type enums, and adapting APIs and components to prioritize address-related operations. The incorporation of new dependencies and reorganization throughout components and hooks reflects this fundamental shift in focus.

Changes

File Path Change Summary
Dockerfile Added wardjs directory to Docker build context.
go-client/query_client_warden.go Removed SignedTransactions function.
proto/warden/.../genesis.proto Removed sign_transaction_requests field from GenesisState.
proto/warden/.../key.proto Added AddressType enum with Ethereum and Osmosis types.
proto/warden/.../query.proto Updated field names, renamed responses, and removed transaction signing RPC methods.
proto/warden/.../signature.proto Adjusted SignRequest fields and introduced SignMethod enum.
proto/warden/.../tx.proto Updated message fields, removed references to wallet.proto, added SignMethod.
spaceward/package.json Added "@wardenprotocol/wardjs" dependency, updated "vite" version.
spaceward/src/components/... Updated types, imports, and logic across various components to align with new address handling.
spaceward/src/hooks/... Introduced and updated hooks for new client management and address-based functionalities.
spaceward/src/routes/... Updated routes to handle new key management and address functionalities.
spaceward/src/utils/formatting.ts Adjusted to use new imports and maintained functionality.

Recent Review Details

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between a67e818 and 1aa7145.
Files selected for processing (1)
  • Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Dockerfile

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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
Contributor

@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: 1

CHANGELOG.md Show resolved Hide resolved
Pitasi added 8 commits April 15, 2024 16:41
We can reuse SignatureRequests for everything, and add a "SignMethod"
input field when creating it to instruct how to parse the input []byte.

This has several benefits:
- less code
- less entities in the appdb, especially large ones containing full
ethereum or L1 transactions
- cleaner API surface
Cleanup dead code, rename "wallets" into "addresses" for clarity and
decouple it from transaction parsing (now called SignMethod).
@Pitasi Pitasi force-pushed the refactor-sig-requests branch from c79b4eb to a67e818 Compare April 15, 2024 14:41
Copy link
Contributor

@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: 1

Comment on lines +6451 to +6557
requiresBuild: true
optional: true

/@rollup/rollup-linux-arm-gnueabihf@4.9.6:
resolution: {integrity: sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==}
/@rollup/rollup-linux-arm-gnueabihf@4.14.3:
resolution: {integrity: sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==}
cpu: [arm]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-arm-musleabihf@4.14.3:
resolution: {integrity: sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==}
cpu: [arm]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-arm64-gnu@4.9.6:
resolution: {integrity: sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==}
/@rollup/rollup-linux-arm64-gnu@4.14.3:
resolution: {integrity: sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==}
cpu: [arm64]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-arm64-musl@4.9.6:
resolution: {integrity: sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==}
/@rollup/rollup-linux-arm64-musl@4.14.3:
resolution: {integrity: sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==}
cpu: [arm64]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-riscv64-gnu@4.9.6:
resolution: {integrity: sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==}
/@rollup/rollup-linux-powerpc64le-gnu@4.14.3:
resolution: {integrity: sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==}
cpu: [ppc64]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-riscv64-gnu@4.14.3:
resolution: {integrity: sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==}
cpu: [riscv64]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-x64-gnu@4.9.6:
resolution: {integrity: sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==}
/@rollup/rollup-linux-s390x-gnu@4.14.3:
resolution: {integrity: sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==}
cpu: [s390x]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-x64-gnu@4.14.3:
resolution: {integrity: sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==}
cpu: [x64]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-linux-x64-musl@4.9.6:
resolution: {integrity: sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==}
/@rollup/rollup-linux-x64-musl@4.14.3:
resolution: {integrity: sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==}
cpu: [x64]
os: [linux]
requiresBuild: true
optional: true

/@rollup/rollup-win32-arm64-msvc@4.9.6:
resolution: {integrity: sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==}
/@rollup/rollup-win32-arm64-msvc@4.14.3:
resolution: {integrity: sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==}
cpu: [arm64]
os: [win32]
requiresBuild: true
optional: true

/@rollup/rollup-win32-ia32-msvc@4.9.6:
resolution: {integrity: sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==}
/@rollup/rollup-win32-ia32-msvc@4.14.3:
resolution: {integrity: sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==}
cpu: [ia32]
os: [win32]
requiresBuild: true
optional: true

/@rollup/rollup-win32-x64-msvc@4.9.6:
resolution: {integrity: sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==}
/@rollup/rollup-win32-x64-msvc@4.14.3:
resolution: {integrity: sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The output from the executed script confirms that the @rollup packages listed in the pnpm-lock.yaml file are indeed set to version 4.14.3 across various platforms and architectures. Additionally, the script output indicates that the @rollup/rollup-win32-x64-msvc package is deprecated and no longer maintained, with a recommendation to use @rollup/plugin-inject instead.

Given this information, it appears that the versions and configurations for the @rollup packages are correctly set as per the snippet provided. However, the deprecation of the @rollup/rollup-win32-x64-msvc package and the recommendation to switch to another package should be addressed to ensure future compatibility and maintenance.

Conclusion

The versions and configurations for the @rollup packages are correctly set as per the provided snippet. However, attention should be given to the deprecation notice for the @rollup/rollup-win32-x64-msvc package. It is recommended to consider transitioning to the suggested @rollup/plugin-inject package for future updates and maintenance.

Analysis chain

Ensure the new versions and configurations for @rollup packages are correctly set and compatible with the project.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Ensure the new versions and configurations for `@rollup` packages are correctly set.
rg '@rollup' spaceward/pnpm-lock.yaml

Length of output: 1746

@Pitasi
Copy link
Contributor Author

Pitasi commented Apr 15, 2024

SpaceWard builds locally but not in Docker or in GitHub Action. I'll continue my investigation to fix that before merging this PR.

@Pitasi Pitasi merged commit 76a9151 into main Apr 16, 2024
5 checks passed
@Pitasi Pitasi deleted the refactor-sig-requests branch April 16, 2024 08:12
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.

1 participant