-
Notifications
You must be signed in to change notification settings - Fork 8
Support multiple fee receiver accounts #100
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b9af72e
support multiple fee receiver accounts
janezpodhostnik 199c8c0
use the FlowFees fee receiver getter
janezpodhostnik c220b1f
Merge main into pr-100: resolve go.mod/go.sum conflicts, update stale…
Kay-Zee aac270d
validate fee receivers: re-select access node on each retry
Kay-Zee 301ae5c
repin flow-go to master now that onflow/flow-go#8632 has merged
janezpodhostnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package config | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestFeeAddresses(t *testing.T) { | ||
| t.Run("defaults to the FlowFees contract account", func(t *testing.T) { | ||
| contracts := &Contracts{FlowFees: "912d5440f7e3769e"} | ||
| require.Equal(t, map[string]bool{ | ||
| "\x91\x2d\x54\x40\xf7\xe3\x76\x9e": true, | ||
| }, contracts.FeeAddresses()) | ||
| }) | ||
|
|
||
| t.Run("includes configured fee receivers", func(t *testing.T) { | ||
| contracts := &Contracts{ | ||
| FlowFees: "912d5440f7e3769e", | ||
| FeeReceivers: []string{ | ||
| "e1ac6b2740d204c2", | ||
| "05cbd2fa5128041d", | ||
| "139fb7c9c82c0e7c", | ||
| }, | ||
| } | ||
| require.Equal(t, map[string]bool{ | ||
| "\x91\x2d\x54\x40\xf7\xe3\x76\x9e": true, | ||
| "\xe1\xac\x6b\x27\x40\xd2\x04\xc2": true, | ||
| "\x05\xcb\xd2\xfa\x51\x28\x04\x1d": true, | ||
| "\x13\x9f\xb7\xc9\xc8\x2c\x0e\x7c": true, | ||
| }, contracts.FeeAddresses()) | ||
| }) | ||
|
|
||
| t.Run("deduplicates a receiver equal to the FlowFees account", func(t *testing.T) { | ||
| contracts := &Contracts{ | ||
| FlowFees: "912d5440f7e3769e", | ||
| FeeReceivers: []string{"912d5440f7e3769e"}, | ||
| } | ||
| require.Len(t, contracts.FeeAddresses(), 1) | ||
| }) | ||
| } |
|
janezpodhostnik marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import FlowFees from 0x{{.Contracts.FlowFees}} | ||
|
|
||
| // Returns the addresses of all accounts that may receive transaction fee | ||
| // deposits: the FlowFees contract account itself, plus any child fee accounts | ||
| // that FlowFees.deductTransactionFee rotates deposits across (see | ||
| // onflow/flow-core-contracts#575, "Enable concurrent fee collection"). | ||
| access(all) fun main(): [Address] { | ||
| return FlowFees.getFeeReceiverAddresses() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Make successful fee-receiver validation a readiness requirement.
Runstarts validation in a goroutine and then starts the HTTP server. If configuration omits an active receiver,ConstructionPreprocesscan accept a construction request for a transfer to that receiver before validation completes. A malformed result or exhausted retries also ends validation with only a log entry, so the service can continue without successful validation.api/api.go#L108-L109: wait for successful validation before serving, or keep the service unready and reject construction requests until validation succeeds.api/validate.go#L45-L56: propagate malformed-result failures to the startup or readiness gate.api/validate.go#L76-L76: propagate retry exhaustion to the startup or readiness gate.README.md#L377-L380: document the finalized readiness behavior.📍 Affects 3 files
api/api.go#L108-L109(this comment)api/validate.go#L45-L56api/validate.go#L76-L76README.md#L377-L380🤖 Prompt for AI Agents