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

node: Flow cancel enhancements and bug fixes #4016

Merged
merged 25 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
72649a4
node: Fix issue where transfers that were loaded from the DB did not add
johnsaigle Jul 2, 2024
e158888
node: Add a command-line flag to enable or disable flow-canceling on …
Jul 9, 2024
e683d0d
node: Use deterministic iteration order over chains when changing Gov…
johnsaigle Jul 10, 2024
46fa143
node: Fix tokenEntry when checking flow cancel for pending transfers
johnsaigle Jun 27, 2024
175e58b
node: Modify error handling for CheckPending method in the Governor
johnsaigle Jul 12, 2024
2044907
node: Add additional metrics for Governor status
johnsaigle Jul 16, 2024
8250e89
node: Add new flow cancel parameter to Governor in tests
johnsaigle Jul 16, 2024
0dc66bf
node: goimports formatting
johnsaigle Jul 16, 2024
75eed88
node: Bug fix in changes to governor monitoring
johnsaigle Jul 17, 2024
18c6986
node: address prealloc lint error in governor code
johnsaigle Jul 17, 2024
5ea919a
node: Fix "generated proto differs from committed proto"
johnsaigle Jul 17, 2024
18f4569
node: Fix bug in chainIds allocation
johnsaigle Jul 17, 2024
0b9d5a4
node: Fix returning nil on err in governor_test.go
johnsaigle Jul 18, 2024
9da4631
node: Cleanup comments in governor code
johnsaigle Jul 18, 2024
a57d252
node: fix governor comment
johnsaigle Jul 18, 2024
821e9b4
node: enable flow cancel in governor_monitoring tests
johnsaigle Jul 18, 2024
a58d243
node: Add flow cancel information to p2p heartbeat features
johnsaigle Jul 18, 2024
881e76b
node: Remove outdated comment from governor
johnsaigle Jul 18, 2024
9e1b933
node: Upgrade logs to Error from Warn when reloading transfers from
johnsaigle Jul 19, 2024
26793aa
node: Enable flow cancel in check_query test function
johnsaigle Jul 22, 2024
d7f3eef
node: Cleanup comments and redundant code in governor
johnsaigle Jul 23, 2024
c20689d
node: Refactor how the flow cancel token list gets populated
johnsaigle Jul 25, 2024
03e6aa7
node: Add unit test for flow cancel feature flag
johnsaigle Jul 25, 2024
4447d6f
node: Move new Governor status proto fields from Emitter to Chain
johnsaigle Jul 30, 2024
ff03fc4
node: lint governor_monitoring
johnsaigle Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ var (
// Prometheus remote write URL
promRemoteURL *string

chainGovernorEnabled *bool
chainGovernorEnabled *bool
governorFlowCancelEnabled *bool

ccqEnabled *bool
ccqAllowedRequesters *string
Expand Down Expand Up @@ -435,6 +436,7 @@ func init() {
promRemoteURL = NodeCmd.Flags().String("promRemoteURL", "", "Prometheus remote write URL (Grafana)")

chainGovernorEnabled = NodeCmd.Flags().Bool("chainGovernorEnabled", false, "Run the chain governor")
governorFlowCancelEnabled = NodeCmd.Flags().Bool("governorFlowCancelEnabled", false, "Enable flow cancel on the governor")

ccqEnabled = NodeCmd.Flags().Bool("ccqEnabled", false, "Enable cross chain query support")
ccqAllowedRequesters = NodeCmd.Flags().String("ccqAllowedRequesters", "", "Comma separated list of signers allowed to submit cross chain queries")
Expand Down Expand Up @@ -541,6 +543,11 @@ func runNode(cmd *cobra.Command, args []string) {
os.Exit(1)
}

if !(*chainGovernorEnabled) && *governorFlowCancelEnabled {
fmt.Println("Flow cancel can only be enabled when the governor is enabled")
os.Exit(1)
}

logger := zap.New(zapcore.NewCore(
consoleEncoder{zapcore.NewConsoleEncoder(
zap.NewDevelopmentEncoderConfig())},
Expand Down Expand Up @@ -1575,7 +1582,7 @@ func runNode(cmd *cobra.Command, args []string) {
node.GuardianOptionDatabase(db),
node.GuardianOptionWatchers(watcherConfigs, ibcWatcherConfig),
node.GuardianOptionAccountant(*accountantWS, *accountantContract, *accountantCheckEnabled, accountantWormchainConn, *accountantNttContract, accountantNttWormchainConn),
node.GuardianOptionGovernor(*chainGovernorEnabled),
node.GuardianOptionGovernor(*chainGovernorEnabled, *governorFlowCancelEnabled),
node.GuardianOptionGatewayRelayer(*gatewayRelayerContract, gatewayRelayerWormchainConn),
node.GuardianOptionQueryHandler(*ccqEnabled, *ccqAllowedRequesters),
node.GuardianOptionAdminService(*adminSocketPath, ethRPC, ethContract, rpcMap),
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/adminrpc/adminserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func Test_adminCommands(t *testing.T) {
}

func newNodePrivilegedServiceForGovernorTests() *nodePrivilegedService {
gov := governor.NewChainGovernor(zap.NewNop(), &db.MockGovernorDB{}, wh_common.GoTest)
gov := governor.NewChainGovernor(zap.NewNop(), &db.MockGovernorDB{}, wh_common.GoTest, false)

return &nodePrivilegedService{
db: nil,
Expand Down
7 changes: 5 additions & 2 deletions node/pkg/governor/devnet_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ func (gov *ChainGovernor) initDevnetConfig() ([]tokenConfigEntry, []tokenConfigE
{chain: 2, addr: "000000000000000000000000DDb64fE46a91D46ee29420539FC25FD07c5FEa3E", symbol: "WETH", coinGeckoId: "weth", decimals: 8, price: 1174},
}

flowCancelTokens := []tokenConfigEntry{
{chain: 1, addr: "3b442cb3912157f13a933d0134282d032b5ffecd01a2dbf1b7790608df002ea7", symbol: "USDC", coinGeckoId: "usdc", decimals: 6, price: 1}, // Addr: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU, Notional: 1
flowCancelTokens := []tokenConfigEntry{}
if gov.flowCancelEnabled {
flowCancelTokens = []tokenConfigEntry{
{chain: 1, addr: "3b442cb3912157f13a933d0134282d032b5ffecd01a2dbf1b7790608df002ea7", symbol: "USDC", coinGeckoId: "usdc", decimals: 6, price: 1}, // Addr: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU, Notional: 1
}
}

chains := []chainConfigEntry{
Expand Down
Loading
Loading