-
Notifications
You must be signed in to change notification settings - Fork 19
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
Nonce Error Handling #365
Nonce Error Handling #365
Conversation
relayer/pkg/chainlink/txm/nonce.go
Outdated
@@ -64,6 +64,23 @@ func (nm *nonceManager) HealthReport() map[string]error { | |||
return map[string]error{nm.Name(): nm.starter.Healthy()} | |||
} | |||
|
|||
func (nm *nonceManager) Sync(ctx context.Context, address *felt.Felt, chainId string, client NonceManagerClient) error { | |||
if err := nm.validate(address, chainId); err != nil { |
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.
nit: we could avoid locking/unlocking twice, eg by refactoring and adding a validateLocked
function which requires the lock to be held as a precondition
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.
oh nice, i didn't realize validate was also locking. i'll leave for now but good catch
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.
feeling like maybe this isn't a nit - could we handle this so it doesn't lock twice?
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.
actually, i think it is better to leave it as is because confirmer and broadcaster both access the nonce manager concurrently. Therefore, even if you check that the lock is held in a hypothetical "validateLocked", you don't know whether the lock was held by the caller of "validateLocked" or by another goroutine.
If it's by another goroutine, then we could be reading the lock when the other goroutine is changing it.
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.
i could just always call validate() within the bounds of the caller's lock. maybe that's what you were referring to all along
Quality Gate failedFailed conditions |
Summary:
Sepolia Testnet: "https://alpha-sepolia.starknet.io/feeder_gateway"
Mainnet: "https://alpha-mainnet.starknet.io/feeder_gateway"
Integration: "https://external.integration.starknet.io/feeder_gateway"
Sepolia Integration: "https://integration-sepolia.starknet.io/feeder_gateway"
Goerli Testnet: "https://alpha4.starknet.io/feeder_gateway"
Goerli Integration: "https://external.integration.starknet.io"
Some less related changes
APIKey = '<>'
in the Node TOML config