Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
cffd037
Attestation report: embedding validator pubkey
Mar 21, 2026
43386a6
misc
Mar 21, 2026
9c51d01
register_new_node - returning embedded owner pubkey
Mar 21, 2026
e982e16
build fix
Mar 21, 2026
db1e888
register_new_node: returning both owner and machine_id
Mar 21, 2026
21bf156
allow_list refactor, both m->o and o->m
Mar 30, 2026
1bfb09b
ecall_authenticate_new_node: updating allow_list state
Mar 30, 2026
44baa28
compute module keeper access to reg keeper
Mar 31, 2026
3842533
machine-swap via enclave
Apr 5, 2026
21327f2
enclave: saving the last apphash
Apr 6, 2026
d8d9932
passing regKeeper by pointer
Apr 6, 2026
f498058
enclave: Merkle proof verification vs last apphash
Apr 6, 2026
80feb7a
regKeeper: passing Merkle proof to enclave
Apr 6, 2026
535d551
misc
Apr 6, 2026
20e60a5
warning fix
Apr 6, 2026
06359c9
enclave: misc
Apr 6, 2026
0d9e826
enclave: enforcing allow-list during runtime
Apr 7, 2026
e0a032e
RaAuthenticate: added replace_machine_id, passing it to the enclave
Apr 9, 2026
3a40ac6
Merge branch 'master' into machine_swap
Apr 9, 2026
0b4924c
enclave: cosmetic (using hex_literal)
Apr 9, 2026
2c4b88b
machine_swap: must provide older machine, simplified impl
Apr 9, 2026
5e10210
tx register: option to specify prev machine_id
Apr 9, 2026
c260288
added proof-of-cloud jwt token support
May 11, 2026
ccb259f
write ecalls data to the db
cboh4 Nov 27, 2025
d3f359f
fix ce
cboh4 Mar 30, 2026
672b3dd
Update cosmos-sdk and tendermint versions for non-sgx
cboh4 Apr 8, 2026
d1d05be
wrap netkeys
cboh4 Mar 30, 2026
3bcfa87
wrap update whitelist
cboh4 Apr 14, 2026
4ccf873
refactor: lower log levels in msg_dispatcher
cboh4 May 12, 2026
3be55ff
update querier logic
cboh4 May 12, 2026
4604292
update go.mod
cboh4 May 13, 2026
d8541de
remove debug printfs
cboh4 May 13, 2026
086d77e
feat: update hardcoded contract admins and add derivative_hooks contract
cboh4 May 6, 2026
392ee12
add testnet contract
cboh4 May 7, 2026
876fb40
update go.mod
cboh4 May 9, 2026
0747737
update go.mod
cboh4 May 13, 2026
01aede7
Build fix (WIP)
May 14, 2026
a04a82c
build fix (2)
May 14, 2026
5194fa3
build fix (merge artifacts)
May 14, 2026
2b0ee8b
attesation: changed print messages when validating machine
May 17, 2026
155d0a7
Merge artifacts fix
May 17, 2026
dca007c
added upgrade handler v1.25
May 17, 2026
e479d18
non-sgx: disabled logInfo prints
May 17, 2026
251c57c
allow_list: machine replace logic fix
May 17, 2026
c2db36f
cosmetic
May 18, 2026
5fbd531
adjusted point to submit machine ids with proofs
May 18, 2026
16fc42b
changed machine allow/disallow logic. (Responding only to disallow)
May 18, 2026
c55693b
cold machine data submit fix
May 20, 2026
f947def
fixed error msgs
May 20, 2026
0d3bfed
tx register: added explicit --replace-machine-id flag
May 20, 2026
7376735
build fix
May 20, 2026
aefb26e
clippy fixes
May 20, 2026
23a723c
Merge remote-tracking branch 'origin/master' into machine_swap
May 20, 2026
e7aa864
build fix
May 21, 2026
dbe5fa4
build fix (2)
May 21, 2026
7422b9b
build fix (3)
May 22, 2026
efc2c0a
build fix (4)
May 22, 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
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package app
import (
"bytes"
"encoding/base64"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"syscall"

Expand Down Expand Up @@ -72,6 +74,7 @@ import (
v1_23_1 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.23.1"
v1_23_2 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.23.2"
v1_24 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.24"
v1_25 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.25"
v1_4 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.4"
v1_5 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.5"
v1_6 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.6"
Expand Down Expand Up @@ -154,6 +157,7 @@ var (
v1_23_1.Upgrade,
v1_23_2.Upgrade,
v1_24.Upgrade,
v1_25.Upgrade,
}
)

Expand Down
4 changes: 3 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,10 @@ func (ak *SecretAppKeepers) InitCustomKeepers(
reg.EnclaveApi{},
homePath,
bootstrap,
app,
)
ak.RegKeeper = &regKeeper
ak.CronKeeper.SetRegKeeper(regKeeper)
ak.CronKeeper.SetRegKeeper(&regKeeper)

// Assaf:
// Rules:
Expand Down Expand Up @@ -539,6 +540,7 @@ func (ak *SecretAppKeepers) InitCustomKeepers(
ak.TransferKeeper,
ak.IbcKeeper.ChannelKeeper,
ak.IbcSwitchKeeper,
ak.RegKeeper,
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
computeDir,
Expand Down
39 changes: 39 additions & 0 deletions app/upgrades/v1.25/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package v1_25

import (
"context"
"fmt"
"os"

"cosmossdk.io/log"
store "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/scrtlabs/SecretNetwork/app/keepers"
"github.com/scrtlabs/SecretNetwork/app/upgrades"
)

const upgradeName = "v1.25"

var Upgrade = upgrades.Upgrade{
UpgradeName: upgradeName,
CreateUpgradeHandler: createUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

func createUpgradeHandler(mm *module.Manager, _ *keepers.SecretAppKeepers, configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
logger := log.NewLogger(os.Stderr)
logger.Info(` _ _ _____ _____ _____ _____ ______ `)
logger.Info(`| | | | __ \ / ____| __ \ /\ | __ \| ____|`)
logger.Info(`| | | | |__) | | __| |__) | / \ | | | | |__ `)
logger.Info(`| | | | ___/| | |_ | _ / / /\ \ | | | | __| `)
logger.Info(`| |__| | | | |__| | | \ \ / ____ \| |__| | |____ `)
logger.Info(` \____/|_| \_____|_| \_\/_/ \_\_____/|______|`)

logger.Info(fmt.Sprintf("Running module migrations for %s...", upgradeName))

return mm.RunMigrations(ctx, configurator, vm)
}
}
3 changes: 3 additions & 0 deletions client/docs/static/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66537,3 +66537,6 @@ definitions:
encrypted_seed:
type: string
format: byte
machine_binding:
type: string
format: byte
49 changes: 46 additions & 3 deletions cmd/secretd/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
flag_no_epid = "no-epid"
flag_no_dcap = "no-dcap"
flag_is_migration_report = "migration"
flag_unbound_attestation = "unbound-attestation"
)

const (
Expand All @@ -47,6 +48,47 @@ const (
pulsarRegistrationService = "https://registration-service-testnet.azurewebsites.net/api/registernode"
)

type PrivValidatorKey struct {
PrivKey struct {
Value string `json:"value"`
} `json:"priv_key"`
}

func CreateAttestationReportEx(cmd *cobra.Command, is_migration_report bool) error {
var ext_sk []byte

unbound_attestation, _ := cmd.Flags().GetBool(flag_unbound_attestation)
if !unbound_attestation {
path := app.DefaultNodeHome + "/config/priv_validator_key.json"

data, err := os.ReadFile(path)
if err != nil {
fmt.Errorf("couldn't read the validator key: %w", err)
return err
}

var key PrivValidatorKey
if err := json.Unmarshal(data, &key); err != nil {
fmt.Errorf("couldn't decode the validator key: %w", err)
return err
}

decoded, err := base64.StdEncoding.DecodeString(key.PrivKey.Value)
if err != nil {
fmt.Errorf("couldn't decode the validator key: %w", err)
return err
}

ext_sk = decoded[:32]
}

_, err := api.CreateAttestationReport(ext_sk, is_migration_report)
if err != nil {
return fmt.Errorf("failed to create attestation report: %w", err)
}
return err
}

func InitAttestation() *cobra.Command {
cmd := &cobra.Command{
Use: "init-enclave [output-file]",
Expand Down Expand Up @@ -96,8 +138,7 @@ blockchain. Writes the certificate in DER format to ~/attestation_cert
}

is_migration_report, _ := cmd.Flags().GetBool(flag_is_migration_report)

_, err = api.CreateAttestationReport(is_migration_report)
err = CreateAttestationReportEx(cmd, is_migration_report)
if err != nil {
return fmt.Errorf("failed to create attestation report: %w", err)
}
Expand All @@ -108,6 +149,7 @@ blockchain. Writes the certificate in DER format to ~/attestation_cert
cmd.Flags().Bool(flag_no_epid, false, "Optional flag to disable EPID attestation")
cmd.Flags().Bool(flag_no_dcap, false, "Optional flag to disable DCAP attestation")
cmd.Flags().Bool(flag_is_migration_report, false, "Create migration report rather then attestation")
cmd.Flags().Bool(flag_unbound_attestation, false, "Optional flag to disable attestation to user binding")

return cmd
}
Expand Down Expand Up @@ -490,7 +532,7 @@ Please report any issues with this command
}
}

_, err = api.CreateAttestationReport(false)
err = CreateAttestationReportEx(cmd, false)
if err != nil {
return fmt.Errorf("failed to create attestation report: %w", err)
}
Expand Down Expand Up @@ -638,6 +680,7 @@ Please report any issues with this command

cmd.Flags().Bool(flag_no_epid, false, "Optional flag to disable EPID attestation")
cmd.Flags().Bool(flag_no_dcap, false, "Optional flag to disable DCAP attestation")
cmd.Flags().Bool(flag_unbound_attestation, false, "Optional flag to disable attestation to user binding")

return cmd
}
13 changes: 10 additions & 3 deletions cosmwasm/enclaves/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cosmwasm/enclaves/execute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ tendermint-proto = { git = "https://github.com/scrtlabs/tendermint-rs", tag = "v
tendermint-light-client-verifier = { git = "https://github.com/scrtlabs/tendermint-rs", tag = "v0.38.0-secret.7", default-features = false, features = ["rust-crypto"] }
rsa = { version = "0.9", default-features = false, features = ["sha2"] }
base64ct = { version = "1.6", default-features = false, features = ["alloc"] }

hex-literal = "0.4"

[dependencies.webpki]
git = "https://github.com/mesalock-linux/webpki"
Expand Down
18 changes: 14 additions & 4 deletions cosmwasm/enclaves/execute/Enclave.edl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,20 @@ enclave {

public sgx_status_t ecall_onchain_approve_machine_id(
[in, count=n_id] const uint8_t* p_id,
uint32_t n_id,
[in, out, count=32] uint8_t* p_proof,
bool is_on_chain
uint32_t n_id
);

public sgx_status_t ecall_submit_machine_swap(
uint32_t index,
[in, count=n_machine_info] const uint8_t* p_machine_info,
uint32_t n_machine_info,
[in, count=n_proof] const uint8_t* p_proof,
uint32_t n_proof
);

public sgx_status_t ecall_get_attestation_report(
[in, count=n_sk] const uint8_t* p_sk,
uint32_t n_sk,
uint32_t flags
);

Expand All @@ -65,7 +73,9 @@ enclave {
uintptr_t cert_len,
[out, count=n_seeds] uint8_t* p_seeds,
uintptr_t n_seeds,
[out] uintptr_t* p_seeds_size
[out] uintptr_t* p_seeds_size,
[in, count=20] const uint8_t* p_machine_pop,
[out, count=52] uint8_t* p_machine_info
);

public NodeAuthResult ecall_check_patch_level(
Expand Down
Loading
Loading