Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.17.0
github.com/stellar/go-stellar-sdk v0.0.0-20251211085638-ba09a6a91775
github.com/stellar/go-stellar-sdk v0.0.0-20260325174035-031e5bfdc4bd
github.com/stellar/go-stellar-xdr-json v0.0.0-20250826185517-ee4033414d38
github.com/stretchr/testify v1.10.0
github.com/xitongsys/parquet-go v1.6.2
Expand Down Expand Up @@ -91,7 +91,7 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 // indirect
github.com/stellar/go-xdr v0.0.0-20260312225820-cc2b0611aabf // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.opencensus.io v0.24.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,12 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
github.com/stellar/go-stellar-sdk v0.0.0-20251211085638-ba09a6a91775 h1:BxsjQ1g8oduCyVJLV2K8GrdVHPrOdzgBVw9FDm3/zV8=
github.com/stellar/go-stellar-sdk v0.0.0-20251211085638-ba09a6a91775/go.mod h1:4osSHRDfb/D7zE2iNjmPdg2Gmbx0M/JLhTM4YcwPW5s=
github.com/stellar/go-stellar-sdk v0.0.0-20260325174035-031e5bfdc4bd h1:WerRnoHDI7w0rAAmJhvKSTG7vy3bnXLH4DZ5gZA54n4=
github.com/stellar/go-stellar-sdk v0.0.0-20260325174035-031e5bfdc4bd/go.mod h1:tLKAQPxa2I5UvGMabBbUXcY3fmgYnfDudrMeK7CDX4w=
github.com/stellar/go-stellar-xdr-json v0.0.0-20250826185517-ee4033414d38 h1:MpBttv9FXBK9N/rNwjVGIEc4NegoYT9eEQiwtkIHw2E=
github.com/stellar/go-stellar-xdr-json v0.0.0-20250826185517-ee4033414d38/go.mod h1:UEZ6EvdC3Cou6N46OJ5SXvbWTlod8gOUI/CvhY1JVaM=
github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 h1:OzCVd0SV5qE3ZcDeSFCmOWLZfEWZ3Oe8KtmSOYKEVWE=
github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2/go.mod h1:yoxyU/M8nl9LKeWIoBrbDPQ7Cy+4jxRcWcOayZ4BMps=
github.com/stellar/go-xdr v0.0.0-20260312225820-cc2b0611aabf h1:GY1RVbX3Hg7poPXEf6yojjP0hyypvgUgZmCqQU9D0xg=
github.com/stellar/go-xdr v0.0.0-20260312225820-cc2b0611aabf/go.mod h1:If+U9Z1W5xU97VrOgJandQT+2dN7/iOpkCrxBJEyF80=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
Expand Down
83 changes: 83 additions & 0 deletions internal/transform/config_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,45 @@ func TransformConfigSetting(ledgerChange ingest.Change, header xdr.LedgerHeaderH
liveSorobanStateSizeWindow = append(liveSorobanStateSizeWindow, uint64(sizeWindow))
}

// P23: ContractParallelCompute (ID=14)
contractParallelCompute, _ := configSetting.GetContractParallelCompute()
ledgerMaxDependentTxClusters := contractParallelCompute.LedgerMaxDependentTxClusters

// P23: ContractLedgerCostExt (ID=15) - TxMaxFootprintEntries
txMaxFootprintEntries := contractLedgerCostV0.TxMaxFootprintEntries

// P23: ContractScpTiming (ID=16)
contractScpTiming, _ := configSetting.GetContractScpTiming()
ledgerTargetCloseTimeMilliseconds := contractScpTiming.LedgerTargetCloseTimeMilliseconds
nominationTimeoutInitialMilliseconds := contractScpTiming.NominationTimeoutInitialMilliseconds
nominationTimeoutIncrementMilliseconds := contractScpTiming.NominationTimeoutIncrementMilliseconds
ballotTimeoutInitialMilliseconds := contractScpTiming.BallotTimeoutInitialMilliseconds
ballotTimeoutIncrementMilliseconds := contractScpTiming.BallotTimeoutIncrementMilliseconds

// P26 CAP-77: Frozen ledger keys (IDs 17-20)
frozenLedgerKeys, _ := configSetting.GetFrozenLedgerKeys()
frozenLedgerKeysBase64, err := marshalEncodedLedgerKeys(frozenLedgerKeys.Keys)
if err != nil {
return ConfigSettingOutput{}, err
}

frozenLedgerKeysDelta, _ := configSetting.GetFrozenLedgerKeysDelta()
frozenLedgerKeysToFreeze, err := marshalEncodedLedgerKeys(frozenLedgerKeysDelta.KeysToFreeze)
if err != nil {
return ConfigSettingOutput{}, err
}
frozenLedgerKeysToUnfreeze, err := marshalEncodedLedgerKeys(frozenLedgerKeysDelta.KeysToUnfreeze)
if err != nil {
return ConfigSettingOutput{}, err
}

freezeBypassTxs, _ := configSetting.GetFreezeBypassTxs()
freezeBypassTxHashes := hashesToHexStrings(freezeBypassTxs.TxHashes)

freezeBypassTxsDelta, _ := configSetting.GetFreezeBypassTxsDelta()
freezeBypassTxsToAdd := hashesToHexStrings(freezeBypassTxsDelta.AddTxs)
freezeBypassTxsToRemove := hashesToHexStrings(freezeBypassTxsDelta.RemoveTxs)

closedAt, err := utils.TimePointToUTCTimeStamp(header.Header.ScpValue.CloseTime)
if err != nil {
return ConfigSettingOutput{}, err
Expand Down Expand Up @@ -170,6 +209,21 @@ func TransformConfigSetting(ledgerChange ingest.Change, header xdr.LedgerHeaderH
LedgerMaxTxCount: uint32(ledgerMaxTxCount),
BucketListSizeWindow: bucketListSizeWindow,
LiveSorobanStateSizeWindow: liveSorobanStateSizeWindow,
// P23 config settings
LedgerMaxDependentTxClusters: uint32(ledgerMaxDependentTxClusters),
TxMaxFootprintEntries: uint32(txMaxFootprintEntries),
LedgerTargetCloseTimeMilliseconds: uint32(ledgerTargetCloseTimeMilliseconds),
NominationTimeoutInitialMilliseconds: uint32(nominationTimeoutInitialMilliseconds),
NominationTimeoutIncrementMilliseconds: uint32(nominationTimeoutIncrementMilliseconds),
BallotTimeoutInitialMilliseconds: uint32(ballotTimeoutInitialMilliseconds),
BallotTimeoutIncrementMilliseconds: uint32(ballotTimeoutIncrementMilliseconds),
// P26 CAP-77 frozen ledger keys
FrozenLedgerKeys: frozenLedgerKeysBase64,
FrozenLedgerKeysToFreeze: frozenLedgerKeysToFreeze,
FrozenLedgerKeysToUnfreeze: frozenLedgerKeysToUnfreeze,
FreezeBypassTxs: freezeBypassTxHashes,
FreezeBypassTxsToAdd: freezeBypassTxsToAdd,
FreezeBypassTxsToRemove: freezeBypassTxsToRemove,
LastModifiedLedger: uint32(ledgerEntry.LastModifiedLedgerSeq),
LedgerEntryChange: uint32(changeType),
Deleted: outputDeleted,
Expand All @@ -191,3 +245,32 @@ func serializeParams(costParams xdr.ContractCostParams) []map[string]string {

return params
}

// marshalEncodedLedgerKeys converts a slice of EncodedLedgerKey (XDR-encoded opaque bytes)
// to a slice of base64 strings using xdr.MarshalBase64, matching the format used
// by transformLedgerKeys in ledger.go.
func marshalEncodedLedgerKeys(keys []xdr.EncodedLedgerKey) ([]string, error) {
result := make([]string, 0, len(keys))
for _, key := range keys {
var ledgerKey xdr.LedgerKey
if err := xdr.SafeUnmarshal(key, &ledgerKey); err != nil {
return nil, fmt.Errorf("could not unmarshal encoded ledger key: %v", err)
}
b64, err := xdr.MarshalBase64(ledgerKey)
if err != nil {
return nil, fmt.Errorf("could not marshal ledger key to base64: %v", err)
}
result = append(result, b64)
}
return result, nil
}

// hashesToHexStrings converts a slice of xdr.Hash to a slice of hex-encoded strings,
// matching the format used by utils.HashToHexString for transaction hashes.
func hashesToHexStrings(hashes []xdr.Hash) []string {
result := make([]string, 0, len(hashes))
for _, h := range hashes {
result = append(result, utils.HashToHexString(h))
}
return result
}
Loading
Loading