Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
51c9ff1
feat: introduce smart account module
yusufozmis Aug 22, 2026
3ad9576
Merge remote-tracking branch 'origin/feat/verification-module' into s…
yusufozmis Aug 24, 2026
cbdf712
feat: define session key and smart contract messages
yusufozmis Aug 24, 2026
5747b02
feat(smartaccounts): introduce SmartAccounts map
yusufozmis Aug 24, 2026
519c903
feat(smartaccounts): define AddPublicKey transaction
yusufozmis Aug 24, 2026
b42d378
fix: update the smart account map's prefix
yusufozmis Aug 24, 2026
e636233
feat: add verification key hash to smart accounts module params
yusufozmis Aug 24, 2026
252aff5
Merge remote-tracking branch 'origin/feat/verification-module' into s…
yusufozmis Aug 24, 2026
f265262
refactor: use proof hash as MsgAddPublicKey's input instead of verifi…
yusufozmis Aug 24, 2026
df40c84
feat: add verification keeper field to smartaccouunts.Keeper
yusufozmis Aug 24, 2026
95ee66c
chore: make smartaccounts map private
yusufozmis Aug 24, 2026
4d359aa
chore: add identity field to public inputs and adjust smart accounts …
yusufozmis Aug 24, 2026
59f0c13
feat: implement AppendSessionKeyToSmartAccount method for future use …
yusufozmis Aug 24, 2026
44122fe
fix: add size check for identity
yusufozmis Aug 24, 2026
159292e
feat: implement ComputePublicInputsHash to compare it with result.Pub…
yusufozmis Aug 24, 2026
f686cf0
feat(smartaccounts): implement AddPublicKey transaction to append ses…
yusufozmis Aug 24, 2026
fda0080
test(smartaccounts): add tests for add public key transaction
yusufozmis Aug 25, 2026
d605ce3
test: add tests for ComputePublicInputsHash
yusufozmis Aug 25, 2026
f989541
test: add tests for smart account keeper methods
yusufozmis Aug 25, 2026
5dc3d16
chore: add verification_key_hash to config
yusufozmis Aug 25, 2026
3e6d2c1
feat: add smart accounts to genesis
yusufozmis Aug 25, 2026
77b7cc6
feat(antehandler): introduce smart account auth mode
yusufozmis Aug 25, 2026
eb476bb
refactor(antehandler): route setpubkey and siggascost for smart accounts
yusufozmis Aug 25, 2026
4c0e5b5
feat(smartaccounts): add a field for authorised cosmos addr to use se…
yusufozmis Aug 25, 2026
ae987dd
chore: use continue at ExportGenesis rather than iter.Next to make su…
yusufozmis Aug 25, 2026
ee9c374
feat(smartaccounts): add a new method to check for a given identity i…
yusufozmis Aug 25, 2026
e63c1c0
feat(antehandler): introduce Smart Account Verifier to authorize tran…
yusufozmis Aug 25, 2026
2092966
test(antehandler): add tests for smart account verifier
yusufozmis Aug 25, 2026
0be09f0
fix: reject session keys with ExpiresAtHeight smaller than currentHeight
yusufozmis Aug 25, 2026
73e7e96
fix: return TxAuthModeCosmos for unspecified tx auth mode
yusufozmis Aug 25, 2026
9db43bc
chore: add comment lines to define certain structs and interfaces
yusufozmis Aug 25, 2026
beb89dc
test(antehandler): add more tests to smart account verifier for more …
yusufozmis Aug 25, 2026
6411929
fix: update script to read verification key hash
yusufozmis Aug 25, 2026
f06a32f
fix: update script to simplify the genesis params read flow
yusufozmis Aug 25, 2026
ce938dc
chore: add nolint tag and remove deprecated func usage in tests to pa…
yusufozmis Aug 25, 2026
53045ce
chore: remove whitespace from tx_auth.proto
yusufozmis Aug 26, 2026
b2af2da
fix: update public input hash to include accountAddress
yusufozmis Aug 26, 2026
451f63f
fix: use verification_id instead of proof hash to enforce uniqueness
yusufozmis Aug 26, 2026
4b11e05
chore: add a comment line to explain the reason for ignoring the erro…
yusufozmis Aug 26, 2026
f2de7bc
feat(smartaccounts): implement GetSessionKeysByIdentity query
yusufozmis Aug 26, 2026
3b87456
fix: add a default verification key hash
yusufozmis Aug 26, 2026
8ba9952
fix: update autocli to get identity input
yusufozmis Aug 26, 2026
44c78c8
feat: add pagination to GetSessionKeysByIdentity query
yusufozmis Aug 26, 2026
97eb711
test: add tests for the GetSessionKeysByIdentity query
yusufozmis Aug 26, 2026
1e01286
fix: update deployment scripts to match with new smartaccounts module
yusufozmis Aug 26, 2026
1e0d371
feat: add a tx sender for cosmos,mina and unspecified auth modes
yusufozmis Aug 26, 2026
4e1611f
feat: implement smart account tx sender
yusufozmis Aug 26, 2026
29e01b8
feat(smartaccounts): implement a small prover for e2e, add verifier t…
yusufozmis Aug 26, 2026
5f11bb8
fix: upgrade libcrypto3 package to patched version
yusufozmis Aug 26, 2026
a5d1ba2
fix(e2e): use dedicated account for Mina authentication
yusufozmis Aug 26, 2026
277ce6d
chore(smartaccounts): document session key limit follow-up
korayakpinar Aug 27, 2026
96bf86c
chore(api): regenerate smart accounts OpenAPI
korayakpinar Aug 27, 2026
ac88f89
fix(deploy): keep verifier sidecars opt-in
korayakpinar Aug 27, 2026
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
73 changes: 73 additions & 0 deletions .github/workflows/auth-mode-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Auth mode transactions

on:
pull_request:
merge_group:

permissions:
contents: read

jobs:
auth-mode-e2e:
name: UNSPECIFIED, Cosmos, Mina, and smart-account transactions
runs-on: ubuntu-latest
timeout-minutes: 90
defaults:
run:
working-directory: pulsar-chain
steps:
- name: Check out Pulsar
uses: actions/checkout@v4
with:
path: pulsar-chain

- name: Check out archive-wrapper contract
uses: actions/checkout@v4
with:
repository: node101-io/archive-wrapper
ref: cd42a203ac6b43d24d9fbd57c323ecd52ea52bd5
path: archive-wrapper

- name: Check out pulsar-verifier contract
uses: actions/checkout@v4
with:
repository: node101-io/pulsar-verifier
ref: e7582ba2aea2fa12b765221003a366868f39b3e8
path: pulsar-verifier

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: pulsar-chain/go.mod
cache: true
cache-dependency-path: pulsar-chain/go.sum

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Run auth-mode transaction E2E
env:
ARCHIVE_WRAPPER_SOURCE: ${{ github.workspace }}/archive-wrapper
AUTH_MODE_E2E_ONLY: "1"
ENABLE_VERIFIER_SIDECARS: "1"
E2E_ARTIFACT_DIR: ${{ github.workspace }}/pulsar-chain/e2e-artifacts
PULSAR_VERIFIER_SOURCE: ${{ github.workspace }}/pulsar-verifier
run: |
set -o pipefail
./scripts/test_archive_wrapper_deployment.sh shared 2>&1 \
| sed -E \
-e 's#postgres://[^ @]+@#postgres://[REDACTED]@#g' \
-e 's/e2e-secret/[REDACTED]/g' \
| tee auth-mode-e2e.log

- name: Upload failure evidence
if: failure()
uses: actions/upload-artifact@v4
with:
name: auth-mode-e2e-failure
if-no-files-found: ignore
path: |
pulsar-chain/auth-mode-e2e.log
pulsar-chain/e2e-artifacts/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ release/
*.log
*.ign
.docker/
.cache/smartaccounts/
.cache/pulsar-verifier/
__pycache__/
*.py[cod]
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

FROM golang:1.26.5-alpine3.24@sha256:0178a641fbb4858c5f1b48e34bdaabe0350a330a1b1149aabd498d0699ff5fb2 AS builder

RUN apk upgrade --no-cache libcrypto3 libssl3

WORKDIR /src

COPY go.mod go.sum ./
Expand All @@ -17,7 +19,8 @@ RUN --mount=type=cache,target=/go/pkg/mod \

FROM alpine:3.24@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b AS runtime

RUN apk add --no-cache bash ca-certificates curl python3
RUN apk upgrade --no-cache libcrypto3 libssl3 \
&& apk add --no-cache bash ca-certificates curl python3

WORKDIR /opt/pulsar

Expand Down
13 changes: 12 additions & 1 deletion app/ante/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
type HandlerOptions struct {
AccountKeeper authante.AccountKeeper
BankKeeper authtypes.BankKeeper
SmartAccountKeeper SmartAccountKeeper
ExtensionOptionChecker authante.ExtensionOptionChecker
FeegrantKeeper authante.FeegrantKeeper
SignModeHandler *txsigning.HandlerMap
Expand Down Expand Up @@ -48,6 +49,10 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "keyregistry keeper is required for ante builder")
}

if options.SmartAccountKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "smart account keeper is required for ante builder")
}

if options.MinaNetworkID == "" {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "mina network ID is required for ante builder")
}
Expand Down Expand Up @@ -77,6 +82,12 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
options.Logger,
)

smartAccountVerifier := NewSmartAccountVerifier(
options.SmartAccountKeeper,
options.AccountKeeper,
options.SignModeHandler,
)

anteDecorators := []sdk.AnteDecorator{
authante.NewSetUpContextDecorator(),
authante.NewExtensionOptionsDecorator(NewTxAuthExtensionOptionChecker(options.ExtensionOptionChecker)),
Expand All @@ -89,7 +100,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
NewRoutedSetPubKeyDecorator(cosmosSetPubKey),
NewRoutedValidateSigCountDecorator(options.AccountKeeper, cosmosValidateSigCount),
NewRoutedSigGasConsumeDecorator(options.AccountKeeper, cosmosSigGasConsume),
NewRoutedSigVerificationDecorator(cosmosSigVerify, minaVerifier),
NewRoutedSigVerificationDecorator(cosmosSigVerify, minaVerifier, smartAccountVerifier),
NewStakingDecorator(options.KeyregistryKeeper),
authante.NewIncrementSequenceDecorator(options.AccountKeeper),
}
Expand Down
116 changes: 76 additions & 40 deletions app/ante/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,21 @@ func (stubBankKeeper) SendCoinsFromAccountToModule(context.Context, sdk.AccAddre
return nil
}

type stubSmartAccountKeeper struct{}

func (stubSmartAccountKeeper) IsSessionKeyAuthorized(
context.Context,
[]byte,
[]byte,
[]byte,
) (bool, error) {
return false, nil
}

var (
_ authante.AccountKeeper = stubAccountKeeper{}
_ authtypes.BankKeeper = stubBankKeeper{}
_ authante.AccountKeeper = stubAccountKeeper{}
_ authtypes.BankKeeper = stubBankKeeper{}
_ appante.SmartAccountKeeper = stubSmartAccountKeeper{}
)

var stubKeyregistryKeeper = &keyregistrykeeper.Keeper{}
Expand All @@ -77,12 +89,13 @@ func TestNewAnteHandler(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
})

require.NoError(t, err)
Expand All @@ -95,11 +108,12 @@ func TestNewAnteHandlerRequiresAccountKeeper(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
})

require.ErrorContains(t, err, "account keeper is required for ante builder")
Expand All @@ -112,11 +126,12 @@ func TestNewAnteHandlerRequiresBankKeeper(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
AccountKeeper: stubAccountKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
})

require.ErrorContains(t, err, "bank keeper is required for ante builder")
Expand All @@ -129,11 +144,12 @@ func TestNewAnteHandlerRequiresSignModeHandler(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
KeyregistryKeeper: stubKeyregistryKeeper,
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
})

require.ErrorContains(t, err, "sign mode handler is required for ante builder")
Expand All @@ -146,11 +162,12 @@ func TestNewAnteHandlerRequiresKeyregistryKeeper(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
})

require.ErrorContains(t, err, "keyregistry keeper is required for ante builder")
Expand All @@ -163,11 +180,12 @@ func TestNewAnteHandlerRequiresMinaNetworkID(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
Logger: log.NewNopLogger(),
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
Logger: log.NewNopLogger(),
})

require.ErrorContains(t, err, "mina network ID is required for ante builder")
Expand All @@ -180,12 +198,13 @@ func TestNewAnteHandlerRejectsUnsupportedMinaNetworkID(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
MinaNetworkID: "unsupported",
Logger: log.NewNopLogger(),
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: "unsupported",
Logger: log.NewNopLogger(),
})

require.ErrorIs(t, err, sdkerrors.ErrLogic)
Expand All @@ -198,14 +217,31 @@ func TestNewAnteHandlerRejectsUnsupportedMinaNetworkID(t *testing.T) {
func TestNewAnteHandlerRequiresLogger(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
SmartAccountKeeper: stubSmartAccountKeeper{},
MinaNetworkID: appante.DefaultMinaNetworkID,
})

require.ErrorContains(t, err, "logger is required for ante builder")
require.Nil(t, anteHandler)
}

func TestNewAnteHandlerRequiresSmartAccountKeeper(t *testing.T) {
t.Parallel()

anteHandler, err := appante.NewAnteHandler(appante.HandlerOptions{
AccountKeeper: stubAccountKeeper{},
BankKeeper: stubBankKeeper{},
SignModeHandler: &txsigning.HandlerMap{},
KeyregistryKeeper: stubKeyregistryKeeper,
MinaNetworkID: appante.DefaultMinaNetworkID,
Logger: log.NewNopLogger(),
})

require.ErrorContains(t, err, "logger is required for ante builder")
require.ErrorContains(t, err, "smart account keeper is required for ante builder")
require.Nil(t, anteHandler)
}
7 changes: 4 additions & 3 deletions app/ante/mina_verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ func TestResolveAuroFieldSignatureNetworkID(t *testing.T) {
}

type verifierAccountKeeper struct {
account sdk.AccountI
params authtypes.Params
account sdk.AccountI
params authtypes.Params
moduleAddress sdk.AccAddress
}

func (k verifierAccountKeeper) GetParams(context.Context) authtypes.Params {
Expand All @@ -96,7 +97,7 @@ func (k verifierAccountKeeper) GetAccount(context.Context, sdk.AccAddress) sdk.A

func (k verifierAccountKeeper) SetAccount(context.Context, sdk.AccountI) {}

func (k verifierAccountKeeper) GetModuleAddress(string) sdk.AccAddress { return nil }
func (k verifierAccountKeeper) GetModuleAddress(string) sdk.AccAddress { return k.moduleAddress }

func (k verifierAccountKeeper) AddressCodec() address.Codec { return nil }

Expand Down
2 changes: 1 addition & 1 deletion app/ante/routed_setpubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (d RoutedSetPubKeyDecorator) AnteHandle(
return ctx, err
}

if mode == TxAuthModeMina {
if mode == TxAuthModeMina || mode == TxAuthModeSmartAccount {
return next(ctx, tx, simulate)
}

Expand Down
30 changes: 30 additions & 0 deletions app/ante/routed_setpubkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,36 @@ func TestRoutedSetPubKeyDecoratorRoutesToCosmosDecorator(t *testing.T) {
require.True(t, nextCalled)
}

func TestRoutedSetPubKeyDecoratorSkipsForSmartAccount(t *testing.T) {
t.Parallel()

ctx := setTxAuthMode(
newTestSDKContext(t),
TxAuthModeSmartAccount,
)

delegate := &recordingDecorator{}
nextCalled := false

_, err := NewRoutedSetPubKeyDecorator(delegate).AnteHandle(
ctx,
nil,
false,
func(
nextCtx sdk.Context,
tx sdk.Tx,
simulate bool,
) (sdk.Context, error) {
nextCalled = true
return nextCtx, nil
},
)

require.NoError(t, err)
require.Zero(t, delegate.calls)
require.True(t, nextCalled)
}

// Mina-auth txs intentionally skip Cosmos pubkey population.
// The decorator should fall through directly to the next handler.
func TestRoutedSetPubKeyDecoratorSkipsForMina(t *testing.T) {
Expand Down
Loading
Loading