fix(kms): make the AWS KMS signer support dynamic-fee transactions#792
Open
renatomaia wants to merge 2 commits into
Open
fix(kms): make the AWS KMS signer support dynamic-fee transactions#792renatomaia wants to merge 2 commits into
renatomaia wants to merge 2 commits into
Conversation
renatomaia
force-pushed
the
fix/awsKmsDynamicFeeSigning
branch
3 times, most recently
from
July 22, 2026 13:04
26060af to
e412f81
Compare
|
Old tests needed to fill in the ARN variable with a valid AWS KMS instance to work. That would cost money and expose secrets, so it is disabled by default. But maybe with the localstack setup it could be enabled or refactored, any thoughts on that? |
renatomaia
force-pushed
the
fix/awsKmsDynamicFeeSigning
branch
3 times, most recently
from
July 23, 2026 22:32
9092af5 to
bae5e92
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the AWS KMS-backed transaction signing path to correctly support EIP-1559 (dynamic-fee) transactions by switching to the appropriate signer family, and adds unit + LocalStack-based integration coverage to prevent regressions.
Changes:
- Use
types.LatestSignerForChainIDfor AWS KMS signing (instead of legacy-onlyNewEIP155Signer). - Add a unit test ensuring dynamic-fee tx signing + sender recovery works.
- Add a LocalStack KMS integration test and wire LocalStack into the integration compose + shard selection.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
internal/config/auth/auth.go |
Switch AWS KMS signing to latest signer; add optional region/endpoint support (currently has a compile issue to fix). |
internal/config/generated.go |
Add generated config key + getter for CARTESI_AUTH_AWS_KMS_ENDPOINT. |
internal/config/generate/Config.toml |
Define the new AWS KMS endpoint config entry for generation. |
internal/kms/signtx_test.go |
Add unit test for signing DynamicFeeTx with AWS KMS factory. |
test/integration/localstack_integration_test.go |
New LocalStack KMS integration suite verifying legacy + dynamic-fee signing end-to-end (currently has a config-setting bug to fix). |
test/compose/compose.integration.yaml |
Add LocalStack service and env wiring for integration-test container. |
Makefile |
Add LocalStack start/stop/restart targets and register an awskms integration shard. |
Files not reviewed (1)
- internal/config/generated.go: Generated file
Comments suppressed due to low confidence (1)
internal/config/auth/auth.go:83
- These
errors.Ischecks referenceconfig.ErrNotDefined, but this file already dot-imports internal/config. After removing the duplicateconfigimport, these references should useErrNotDefineddirectly.
kmsRegion, err := GetAuthAwsKmsRegion()
if !errors.Is(err, config.ErrNotDefined) {
if err != nil {
return nil, err
}
awsOpts = append(awsOpts, aws_cfg.WithRegion(kmsRegion.Value))
}
kmsEndpoint, err := GetAuthAwsKmsEndpoint()
if !errors.Is(err, config.ErrNotDefined) {
if err != nil {
return nil, err
}
awsOpts = append(awsOpts, aws_cfg.WithBaseEndpoint(kmsEndpoint.Value))
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
renatomaia
force-pushed
the
fix/awsKmsDynamicFeeSigning
branch
from
July 24, 2026 12:12
bae5e92 to
432a6f9
Compare
renatomaia
force-pushed
the
fix/awsKmsDynamicFeeSigning
branch
from
July 24, 2026 12:17
432a6f9 to
4d1433c
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The AWS KMS factory is still built with
types.NewEIP155Signer(chainId). That signer is legacy-only. Direct geth bindings can create dynamic-fee transactions whenGasPriceis nil and the chain has a base fee, which is the normal EIP-1559 path. In that case the KMS code hashes and attaches the signature using the wrong signer family.Tests
types.DynamicFeeTx, the transaction is signed withtypes.LatestSignerForChainID, and sender recovery succeeds.LOCALSTACK_KMS_ENDPOINTis set.