Skip to content

[Feat] add flow chain#77

Open
tanut32039 wants to merge 6 commits intomainfrom
add-flow-chain
Open

[Feat] add flow chain#77
tanut32039 wants to merge 6 commits intomainfrom
add-flow-chain

Conversation

@tanut32039
Copy link
Copy Markdown
Contributor

Fixed: #XXXX

Implementation details

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class Flow chain support to the relayer by introducing a Flow chain provider/client, Flow remote-signing wallet integration, FKMS protobuf RPCs for Flow signing, and database/config updates needed to track Flow transactions.

Changes:

  • Introduce relayer/chains/flow (provider, client, config, Cadence script) plus unit tests and mocks.
  • Add Flow wallet adapter + remote signer wiring and register Flow wallet creation in the filesystem store.
  • Extend DB schema/model to include packet_timestamp, add Flow chain type, and update config parsing/tests + FKMS proto definitions.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
relayer/wallet/flow/wallet.go Flow wallet constructor using BaseWallet + Flow adapter
relayer/wallet/flow/types.go Defines JSON payload used for remote Flow signing
relayer/wallet/flow/remote_signer.go Implements FKMS-backed signer calling SignFlow RPC
relayer/wallet/flow/adapter.go WalletAdapter implementation for Flow (remote-only)
relayer/store/filesystem.go Registers Flow wallet creation by chain type
relayer/db/types.go Adds PacketTimestamp to Transaction + constructor param
relayer/db/sql.go Renames DB handle field and adds packet_timestamp upsert + new “latest success sequence” query
relayer/db/migrations/postgres/00005_add_packet_timestamp.sql Postgres migration adding packet_timestamp column
relayer/db/migrations/postgres/00004_add_flow_chain_type.sql Postgres migration adding flow to chain_type enum
relayer/db/db.go Database interface now returns latest successful sequence
relayer/config/config_test.go Adds Flow config parsing/loading tests
relayer/config/config.go Adds Flow chain config decoding support
relayer/chains/xrpl/provider.go Persists packet_timestamp when creating DB transactions
relayer/chains/types/chain_type.go Adds ChainTypeFlow and string mapping
relayer/chains/flow/script.go Adds Cadence transaction template used for relaying
relayer/chains/flow/provider_test.go Adds Flow provider unit tests
relayer/chains/flow/provider.go Implements FlowChainProvider relay/query logic + DB persistence + metrics
relayer/chains/flow/config.go Flow chain provider configuration + factory
relayer/chains/flow/client.go Flow HTTP client pool + blockchain interactions
relayer/chains/evm/provider.go Persists packet_timestamp when creating DB transactions
relayer/alert/alert.go Adds alert topic for Flow script execution failure
proto/fkms/v1/signer_grpc.pb.go Adds gRPC stubs for SignFlow
proto/fkms/v1/signer.proto Adds SignFlow RPC, Flow payload types, and FLOW enum
proto/fkms/v1/signer.pb.go Generated protobuf updates for Flow support
internal/relayertest/testdata/flow_chain_config.toml Adds Flow chain TOML fixture
internal/relayertest/mocks/signer_grpc.go Updates FKMS mocks to include SignFlow
internal/relayertest/mocks/chain_flow_client.go Adds Flow client mock (generated)
internal/relayertest/constants.go Embeds Flow chain config fixture
go.mod Adds indirect deps for Flow SDK and transitive requirements
go.sum Lockfile updates for added dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 30 out of 31 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

relayer/db/sql.go:26

  • The NewSQL doc/comment and splitDbPath examples still reference the driver name postgresql, but the implementation only accepts postgres (and the README now documents postgres). As written, a user following the postgresql:... example would hit ErrUnsupportedDriver. Please update the comment/examples to match the actual accepted driver names.
	Db *gorm.DB
}

// NewSQL opens a new Gorm connection using the given driverName and dbPath.
// Supported drivers: "postgresql", "sqlite".
func NewSQL(dbPath string) (SQL, error) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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