diff --git a/go.mod b/go.mod index 8bb69c12..2af1018e 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 4df33d6e..eb8d2baa 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/transform/config_setting.go b/internal/transform/config_setting.go index 1c01571a..ddeeb281 100644 --- a/internal/transform/config_setting.go +++ b/internal/transform/config_setting.go @@ -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 @@ -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, @@ -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 +} diff --git a/internal/transform/config_setting_test.go b/internal/transform/config_setting_test.go index 4bcb4816..dbaa4465 100644 --- a/internal/transform/config_setting_test.go +++ b/internal/transform/config_setting_test.go @@ -73,6 +73,107 @@ func makeConfigSettingTestInput() []ingest.Change { }, } + // P23: ContractParallelCompute (ID=14) + parallelCompute := xdr.ConfigSettingContractParallelComputeV0{ + LedgerMaxDependentTxClusters: 5, + } + parallelComputeEntry := xdr.LedgerEntry{ + LastModifiedLedgerSeq: 24229504, + Data: xdr.LedgerEntryData{ + Type: xdr.LedgerEntryTypeConfigSetting, + ConfigSetting: &xdr.ConfigSettingEntry{ + ConfigSettingId: xdr.ConfigSettingIdConfigSettingContractParallelComputeV0, + ContractParallelCompute: ¶llelCompute, + }, + }, + } + + // P23: ContractLedgerCostExt (ID=15) + ledgerCostExt := xdr.ConfigSettingContractLedgerCostExtV0{ + TxMaxFootprintEntries: 100, + FeeWrite1Kb: 2000, + } + ledgerCostExtEntry := xdr.LedgerEntry{ + LastModifiedLedgerSeq: 24229505, + Data: xdr.LedgerEntryData{ + Type: xdr.LedgerEntryTypeConfigSetting, + ConfigSetting: &xdr.ConfigSettingEntry{ + ConfigSettingId: xdr.ConfigSettingIdConfigSettingContractLedgerCostExtV0, + ContractLedgerCostExt: &ledgerCostExt, + }, + }, + } + + // P23: ContractScpTiming (ID=16) + scpTiming := xdr.ConfigSettingScpTiming{ + LedgerTargetCloseTimeMilliseconds: 5000, + NominationTimeoutInitialMilliseconds: 1000, + NominationTimeoutIncrementMilliseconds: 500, + BallotTimeoutInitialMilliseconds: 1000, + BallotTimeoutIncrementMilliseconds: 1000, + } + scpTimingEntry := xdr.LedgerEntry{ + LastModifiedLedgerSeq: 24229506, + Data: xdr.LedgerEntryData{ + Type: xdr.LedgerEntryTypeConfigSetting, + ConfigSetting: &xdr.ConfigSettingEntry{ + ConfigSettingId: xdr.ConfigSettingIdConfigSettingScpTiming, + ContractScpTiming: &scpTiming, + }, + }, + } + + // P26 CAP-77: FrozenLedgerKeys (ID=17) + // Create valid XDR-encoded LedgerKey bytes for testing + testLedgerKey1 := xdr.LedgerKey{ + Type: xdr.LedgerEntryTypeAccount, + Account: &xdr.LedgerKeyAccount{ + AccountId: xdr.MustAddress("GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7"), + }, + } + testLedgerKey2 := xdr.LedgerKey{ + Type: xdr.LedgerEntryTypeAccount, + Account: &xdr.LedgerKeyAccount{ + AccountId: xdr.MustAddress("GCO2IP3MJNUOKS4PUDI4C7LGGMQDJGXG3COYX3WSB4HHNAHKYV5YL3VC"), + }, + } + encodedKey1, _ := testLedgerKey1.MarshalBinary() + encodedKey2, _ := testLedgerKey2.MarshalBinary() + frozenKeys := xdr.FrozenLedgerKeys{ + Keys: []xdr.EncodedLedgerKey{ + xdr.EncodedLedgerKey(encodedKey1), + xdr.EncodedLedgerKey(encodedKey2), + }, + } + frozenKeysEntry := xdr.LedgerEntry{ + LastModifiedLedgerSeq: 24229507, + Data: xdr.LedgerEntryData{ + Type: xdr.LedgerEntryTypeConfigSetting, + ConfigSetting: &xdr.ConfigSettingEntry{ + ConfigSettingId: xdr.ConfigSettingIdConfigSettingFrozenLedgerKeys, + FrozenLedgerKeys: &frozenKeys, + }, + }, + } + + // P26 CAP-77: FreezeBypassTxs (ID=19) + var txHash1, txHash2 xdr.Hash + copy(txHash1[:], []byte("aaaabbbbccccddddeeeeffffgggghhhh")) + copy(txHash2[:], []byte("11112222333344445555666677778888")) + bypassTxs := xdr.FreezeBypassTxs{ + TxHashes: []xdr.Hash{txHash1, txHash2}, + } + bypassTxsEntry := xdr.LedgerEntry{ + LastModifiedLedgerSeq: 24229508, + Data: xdr.LedgerEntryData{ + Type: xdr.LedgerEntryTypeConfigSetting, + ConfigSetting: &xdr.ConfigSettingEntry{ + ConfigSettingId: xdr.ConfigSettingIdConfigSettingFreezeBypassTxs, + FreezeBypassTxs: &bypassTxs, + }, + }, + } + return []ingest.Change{ { ChangeType: xdr.LedgerEntryChangeTypeLedgerEntryUpdated, @@ -80,77 +181,220 @@ func makeConfigSettingTestInput() []ingest.Change { Pre: &xdr.LedgerEntry{}, Post: &contractDataLedgerEntry, }, + { + ChangeType: xdr.LedgerEntryChangeTypeLedgerEntryCreated, + Type: xdr.LedgerEntryTypeConfigSetting, + Pre: nil, + Post: ¶llelComputeEntry, + }, + { + ChangeType: xdr.LedgerEntryChangeTypeLedgerEntryCreated, + Type: xdr.LedgerEntryTypeConfigSetting, + Pre: nil, + Post: &ledgerCostExtEntry, + }, + { + ChangeType: xdr.LedgerEntryChangeTypeLedgerEntryCreated, + Type: xdr.LedgerEntryTypeConfigSetting, + Pre: nil, + Post: &scpTimingEntry, + }, + { + ChangeType: xdr.LedgerEntryChangeTypeLedgerEntryCreated, + Type: xdr.LedgerEntryTypeConfigSetting, + Pre: nil, + Post: &frozenKeysEntry, + }, + { + ChangeType: xdr.LedgerEntryChangeTypeLedgerEntryCreated, + Type: xdr.LedgerEntryTypeConfigSetting, + Pre: nil, + Post: &bypassTxsEntry, + }, } } func makeConfigSettingTestOutput() []ConfigSettingOutput { contractMapType := make([]map[string]string, 0) bucket := make([]uint64, 0) + emptyStrSlice := make([]string, 0) + + // Base output with all zero values (for ContractMaxSizeBytes test) + baseOutput := ConfigSettingOutput{ + ConfigSettingId: 0, + ContractMaxSizeBytes: 0, + LedgerMaxInstructions: 0, + TxMaxInstructions: 0, + FeeRatePerInstructionsIncrement: 0, + TxMemoryLimit: 0, + LedgerMaxReadLedgerEntries: 0, + LedgerMaxDiskReadEntries: 0, + LedgerMaxReadBytes: 0, + LedgerMaxDiskReadBytes: 0, + LedgerMaxWriteLedgerEntries: 0, + LedgerMaxWriteBytes: 0, + TxMaxReadLedgerEntries: 0, + TxMaxDiskReadEntries: 0, + TxMaxReadBytes: 0, + TxMaxDiskReadBytes: 0, + TxMaxWriteLedgerEntries: 0, + TxMaxWriteBytes: 0, + FeeReadLedgerEntry: 0, + FeeDiskReadLedgerEntry: 0, + FeeWriteLedgerEntry: 0, + FeeRead1Kb: 0, + FeeWrite1Kb: 0, + FeeDiskRead1Kb: 0, + BucketListTargetSizeBytes: 0, + SorobanStateTargetSizeBytes: 0, + WriteFee1KbBucketListLow: 0, + RentFee1KBSorobanStateSizeLow: 0, + WriteFee1KbBucketListHigh: 0, + RentFee1KBSorobanStateSizeHigh: 0, + BucketListWriteFeeGrowthFactor: 0, + SorobanStateRentFeeGrowthFactor: 0, + FeeHistorical1Kb: 0, + TxMaxContractEventsSizeBytes: 0, + FeeContractEvents1Kb: 0, + LedgerMaxTxsSizeBytes: 0, + TxMaxSizeBytes: 0, + FeeTxSize1Kb: 0, + ContractCostParamsCpuInsns: contractMapType, + ContractCostParamsMemBytes: contractMapType, + ContractDataKeySizeBytes: 0, + ContractDataEntrySizeBytes: 0, + MaxEntryTtl: 0, + MinTemporaryTtl: 0, + MinPersistentTtl: 0, + AutoBumpLedgers: 0, + PersistentRentRateDenominator: 0, + TempRentRateDenominator: 0, + MaxEntriesToArchive: 0, + BucketListSizeWindowSampleSize: 0, + LiveSorobanStateSizeWindowSampleSize: 0, + LiveSorobanStateSizeWindowSamplePeriod: 0, + EvictionScanSize: 0, + StartingEvictionScanLevel: 0, + LedgerMaxTxCount: 0, + BucketListSizeWindow: bucket, + LiveSorobanStateSizeWindow: bucket, + LedgerMaxDependentTxClusters: 0, + TxMaxFootprintEntries: 0, + LedgerTargetCloseTimeMilliseconds: 0, + NominationTimeoutInitialMilliseconds: 0, + NominationTimeoutIncrementMilliseconds: 0, + BallotTimeoutInitialMilliseconds: 0, + BallotTimeoutIncrementMilliseconds: 0, + FrozenLedgerKeys: emptyStrSlice, + FrozenLedgerKeysToFreeze: emptyStrSlice, + FrozenLedgerKeysToUnfreeze: emptyStrSlice, + FreezeBypassTxs: emptyStrSlice, + FreezeBypassTxsToAdd: emptyStrSlice, + FreezeBypassTxsToRemove: emptyStrSlice, + LastModifiedLedger: 24229503, + LedgerEntryChange: 1, + Deleted: false, + LedgerSequence: 10, + ClosedAt: time.Date(1970, time.January, 1, 0, 16, 40, 0, time.UTC), + } + + // P23: ContractParallelCompute output + parallelComputeOutput := baseOutput + parallelComputeOutput.ConfigSettingId = 14 + parallelComputeOutput.LedgerMaxDependentTxClusters = 5 + parallelComputeOutput.LastModifiedLedger = 24229504 + parallelComputeOutput.LedgerEntryChange = 0 + parallelComputeOutput.ContractCostParamsCpuInsns = contractMapType + parallelComputeOutput.ContractCostParamsMemBytes = contractMapType + parallelComputeOutput.BucketListSizeWindow = bucket + parallelComputeOutput.LiveSorobanStateSizeWindow = bucket + parallelComputeOutput.FrozenLedgerKeys = emptyStrSlice + parallelComputeOutput.FrozenLedgerKeysToFreeze = emptyStrSlice + parallelComputeOutput.FrozenLedgerKeysToUnfreeze = emptyStrSlice + parallelComputeOutput.FreezeBypassTxs = emptyStrSlice + parallelComputeOutput.FreezeBypassTxsToAdd = emptyStrSlice + parallelComputeOutput.FreezeBypassTxsToRemove = emptyStrSlice + + // P23: ContractLedgerCostExt output + ledgerCostExtOutput := baseOutput + ledgerCostExtOutput.ConfigSettingId = 15 + ledgerCostExtOutput.TxMaxFootprintEntries = 100 + ledgerCostExtOutput.FeeWrite1Kb = 2000 + ledgerCostExtOutput.LastModifiedLedger = 24229505 + ledgerCostExtOutput.LedgerEntryChange = 0 + ledgerCostExtOutput.ContractCostParamsCpuInsns = contractMapType + ledgerCostExtOutput.ContractCostParamsMemBytes = contractMapType + ledgerCostExtOutput.BucketListSizeWindow = bucket + ledgerCostExtOutput.LiveSorobanStateSizeWindow = bucket + ledgerCostExtOutput.FrozenLedgerKeys = emptyStrSlice + ledgerCostExtOutput.FrozenLedgerKeysToFreeze = emptyStrSlice + ledgerCostExtOutput.FrozenLedgerKeysToUnfreeze = emptyStrSlice + ledgerCostExtOutput.FreezeBypassTxs = emptyStrSlice + ledgerCostExtOutput.FreezeBypassTxsToAdd = emptyStrSlice + ledgerCostExtOutput.FreezeBypassTxsToRemove = emptyStrSlice + + // P23: ContractScpTiming output + scpTimingOutput := baseOutput + scpTimingOutput.ConfigSettingId = 16 + scpTimingOutput.LedgerTargetCloseTimeMilliseconds = 5000 + scpTimingOutput.NominationTimeoutInitialMilliseconds = 1000 + scpTimingOutput.NominationTimeoutIncrementMilliseconds = 500 + scpTimingOutput.BallotTimeoutInitialMilliseconds = 1000 + scpTimingOutput.BallotTimeoutIncrementMilliseconds = 1000 + scpTimingOutput.LastModifiedLedger = 24229506 + scpTimingOutput.LedgerEntryChange = 0 + scpTimingOutput.ContractCostParamsCpuInsns = contractMapType + scpTimingOutput.ContractCostParamsMemBytes = contractMapType + scpTimingOutput.BucketListSizeWindow = bucket + scpTimingOutput.LiveSorobanStateSizeWindow = bucket + scpTimingOutput.FrozenLedgerKeys = emptyStrSlice + scpTimingOutput.FrozenLedgerKeysToFreeze = emptyStrSlice + scpTimingOutput.FrozenLedgerKeysToUnfreeze = emptyStrSlice + scpTimingOutput.FreezeBypassTxs = emptyStrSlice + scpTimingOutput.FreezeBypassTxsToAdd = emptyStrSlice + scpTimingOutput.FreezeBypassTxsToRemove = emptyStrSlice + + // P26 CAP-77: FrozenLedgerKeys output (ID=17) + frozenKeysOutput := baseOutput + frozenKeysOutput.ConfigSettingId = 17 + frozenKeysOutput.LastModifiedLedger = 24229507 + frozenKeysOutput.LedgerEntryChange = 0 + frozenKeysOutput.ContractCostParamsCpuInsns = contractMapType + frozenKeysOutput.ContractCostParamsMemBytes = contractMapType + frozenKeysOutput.BucketListSizeWindow = bucket + frozenKeysOutput.LiveSorobanStateSizeWindow = bucket + frozenKeysOutput.FrozenLedgerKeys = []string{"AAAAAAAAAAABlHJijueOuScU0i0DkJY8JNkn6gCZmUhuiR+sLaqcIQ==", "AAAAAAAAAACdpD9sS2jlS4+g0cF9ZjMgNJrm2J2L7tIPDnaA6sV7hQ=="} + frozenKeysOutput.FrozenLedgerKeysToFreeze = emptyStrSlice + frozenKeysOutput.FrozenLedgerKeysToUnfreeze = emptyStrSlice + frozenKeysOutput.FreezeBypassTxs = emptyStrSlice + frozenKeysOutput.FreezeBypassTxsToAdd = emptyStrSlice + frozenKeysOutput.FreezeBypassTxsToRemove = emptyStrSlice + + // P26 CAP-77: FreezeBypassTxs output (ID=19) + bypassTxsOutput := baseOutput + bypassTxsOutput.ConfigSettingId = 19 + bypassTxsOutput.LastModifiedLedger = 24229508 + bypassTxsOutput.LedgerEntryChange = 0 + bypassTxsOutput.ContractCostParamsCpuInsns = contractMapType + bypassTxsOutput.ContractCostParamsMemBytes = contractMapType + bypassTxsOutput.BucketListSizeWindow = bucket + bypassTxsOutput.LiveSorobanStateSizeWindow = bucket + bypassTxsOutput.FrozenLedgerKeys = emptyStrSlice + bypassTxsOutput.FrozenLedgerKeysToFreeze = emptyStrSlice + bypassTxsOutput.FrozenLedgerKeysToUnfreeze = emptyStrSlice + bypassTxsOutput.FreezeBypassTxs = []string{ + "6161616162626262636363636464646465656565666666666767676768686868", + "3131313132323232333333333434343435353535363636363737373738383838", + } + bypassTxsOutput.FreezeBypassTxsToAdd = emptyStrSlice + bypassTxsOutput.FreezeBypassTxsToRemove = emptyStrSlice return []ConfigSettingOutput{ - { - ConfigSettingId: 0, - ContractMaxSizeBytes: 0, - LedgerMaxInstructions: 0, - TxMaxInstructions: 0, - FeeRatePerInstructionsIncrement: 0, - TxMemoryLimit: 0, - LedgerMaxReadLedgerEntries: 0, - LedgerMaxDiskReadEntries: 0, - LedgerMaxReadBytes: 0, - LedgerMaxDiskReadBytes: 0, - LedgerMaxWriteLedgerEntries: 0, - LedgerMaxWriteBytes: 0, - TxMaxReadLedgerEntries: 0, - TxMaxDiskReadEntries: 0, - TxMaxReadBytes: 0, - TxMaxDiskReadBytes: 0, - TxMaxWriteLedgerEntries: 0, - TxMaxWriteBytes: 0, - FeeReadLedgerEntry: 0, - FeeDiskReadLedgerEntry: 0, - FeeWriteLedgerEntry: 0, - FeeRead1Kb: 0, - FeeWrite1Kb: 0, - FeeDiskRead1Kb: 0, - BucketListTargetSizeBytes: 0, - SorobanStateTargetSizeBytes: 0, - WriteFee1KbBucketListLow: 0, - RentFee1KBSorobanStateSizeLow: 0, - WriteFee1KbBucketListHigh: 0, - RentFee1KBSorobanStateSizeHigh: 0, - BucketListWriteFeeGrowthFactor: 0, - SorobanStateRentFeeGrowthFactor: 0, - FeeHistorical1Kb: 0, - TxMaxContractEventsSizeBytes: 0, - FeeContractEvents1Kb: 0, - LedgerMaxTxsSizeBytes: 0, - TxMaxSizeBytes: 0, - FeeTxSize1Kb: 0, - ContractCostParamsCpuInsns: contractMapType, - ContractCostParamsMemBytes: contractMapType, - ContractDataKeySizeBytes: 0, - ContractDataEntrySizeBytes: 0, - MaxEntryTtl: 0, - MinTemporaryTtl: 0, - MinPersistentTtl: 0, - AutoBumpLedgers: 0, - PersistentRentRateDenominator: 0, - TempRentRateDenominator: 0, - MaxEntriesToArchive: 0, - BucketListSizeWindowSampleSize: 0, - LiveSorobanStateSizeWindowSampleSize: 0, - LiveSorobanStateSizeWindowSamplePeriod: 0, - EvictionScanSize: 0, - StartingEvictionScanLevel: 0, - LedgerMaxTxCount: 0, - BucketListSizeWindow: bucket, - LiveSorobanStateSizeWindow: bucket, - LastModifiedLedger: 24229503, - LedgerEntryChange: 1, - Deleted: false, - LedgerSequence: 10, - ClosedAt: time.Date(1970, time.January, 1, 0, 16, 40, 0, time.UTC), - }, + baseOutput, + parallelComputeOutput, + ledgerCostExtOutput, + scpTimingOutput, + frozenKeysOutput, + bypassTxsOutput, } } diff --git a/internal/transform/parquet_converter.go b/internal/transform/parquet_converter.go index 1b863aa4..8156830a 100644 --- a/internal/transform/parquet_converter.go +++ b/internal/transform/parquet_converter.go @@ -402,6 +402,21 @@ func (cso ConfigSettingOutput) ToParquet() interface{} { LedgerMaxTxCount: int64(cso.LedgerMaxTxCount), BucketListSizeWindow: BucketListSizeWindowInt, LiveSorobanStateSizeWindow: BucketListSizeWindowInt, + // P23 config settings + LedgerMaxDependentTxClusters: int64(cso.LedgerMaxDependentTxClusters), + TxMaxFootprintEntries: int64(cso.TxMaxFootprintEntries), + LedgerTargetCloseTimeMilliseconds: int64(cso.LedgerTargetCloseTimeMilliseconds), + NominationTimeoutInitialMilliseconds: int64(cso.NominationTimeoutInitialMilliseconds), + NominationTimeoutIncrementMilliseconds: int64(cso.NominationTimeoutIncrementMilliseconds), + BallotTimeoutInitialMilliseconds: int64(cso.BallotTimeoutInitialMilliseconds), + BallotTimeoutIncrementMilliseconds: int64(cso.BallotTimeoutIncrementMilliseconds), + // P26 CAP-77 frozen ledger keys + FrozenLedgerKeys: toJSONString(cso.FrozenLedgerKeys), + FrozenLedgerKeysToFreeze: toJSONString(cso.FrozenLedgerKeysToFreeze), + FrozenLedgerKeysToUnfreeze: toJSONString(cso.FrozenLedgerKeysToUnfreeze), + FreezeBypassTxs: toJSONString(cso.FreezeBypassTxs), + FreezeBypassTxsToAdd: toJSONString(cso.FreezeBypassTxsToAdd), + FreezeBypassTxsToRemove: toJSONString(cso.FreezeBypassTxsToRemove), LastModifiedLedger: int64(cso.LastModifiedLedger), LedgerEntryChange: int64(cso.LedgerEntryChange), Deleted: cso.Deleted, diff --git a/internal/transform/schema.go b/internal/transform/schema.go index ea7f5a0c..e048846e 100644 --- a/internal/transform/schema.go +++ b/internal/transform/schema.go @@ -619,6 +619,21 @@ type ConfigSettingOutput struct { LedgerMaxTxCount uint32 `json:"ledger_max_tx_count"` BucketListSizeWindow []uint64 `json:"bucket_list_size_window"` LiveSorobanStateSizeWindow []uint64 `json:"live_soroban_state_size_window"` + // P23 config settings + LedgerMaxDependentTxClusters uint32 `json:"ledger_max_dependent_tx_clusters"` + TxMaxFootprintEntries uint32 `json:"tx_max_footprint_entries"` + LedgerTargetCloseTimeMilliseconds uint32 `json:"ledger_target_close_time_milliseconds"` + NominationTimeoutInitialMilliseconds uint32 `json:"nomination_timeout_initial_milliseconds"` + NominationTimeoutIncrementMilliseconds uint32 `json:"nomination_timeout_increment_milliseconds"` + BallotTimeoutInitialMilliseconds uint32 `json:"ballot_timeout_initial_milliseconds"` + BallotTimeoutIncrementMilliseconds uint32 `json:"ballot_timeout_increment_milliseconds"` + // P26 CAP-77 frozen ledger keys + FrozenLedgerKeys []string `json:"frozen_ledger_keys"` + FrozenLedgerKeysToFreeze []string `json:"frozen_ledger_keys_to_freeze"` + FrozenLedgerKeysToUnfreeze []string `json:"frozen_ledger_keys_to_unfreeze"` + FreezeBypassTxs []string `json:"freeze_bypass_txs"` + FreezeBypassTxsToAdd []string `json:"freeze_bypass_txs_to_add"` + FreezeBypassTxsToRemove []string `json:"freeze_bypass_txs_to_remove"` LastModifiedLedger uint32 `json:"last_modified_ledger"` LedgerEntryChange uint32 `json:"ledger_entry_change"` Deleted bool `json:"deleted"` diff --git a/internal/transform/schema_parquet.go b/internal/transform/schema_parquet.go index c7c3698b..49136c65 100644 --- a/internal/transform/schema_parquet.go +++ b/internal/transform/schema_parquet.go @@ -361,6 +361,21 @@ type ConfigSettingOutputParquet struct { LedgerMaxTxCount int64 `parquet:"name=ledger_max_tx_count, type=INT64, convertedtype=UINT_64"` BucketListSizeWindow []int64 `parquet:"name=bucket_list_size_window, type=INT64, repetitiontype=REPEATED"` LiveSorobanStateSizeWindow []int64 `parquet:"name=live_soroban_state_size_window, type=INT64, repetitiontype=REPEATED"` + // P23 config settings + LedgerMaxDependentTxClusters int64 `parquet:"name=ledger_max_dependent_tx_clusters, type=INT64, convertedtype=UINT_64"` + TxMaxFootprintEntries int64 `parquet:"name=tx_max_footprint_entries, type=INT64, convertedtype=UINT_64"` + LedgerTargetCloseTimeMilliseconds int64 `parquet:"name=ledger_target_close_time_milliseconds, type=INT64, convertedtype=UINT_64"` + NominationTimeoutInitialMilliseconds int64 `parquet:"name=nomination_timeout_initial_milliseconds, type=INT64, convertedtype=UINT_64"` + NominationTimeoutIncrementMilliseconds int64 `parquet:"name=nomination_timeout_increment_milliseconds, type=INT64, convertedtype=UINT_64"` + BallotTimeoutInitialMilliseconds int64 `parquet:"name=ballot_timeout_initial_milliseconds, type=INT64, convertedtype=UINT_64"` + BallotTimeoutIncrementMilliseconds int64 `parquet:"name=ballot_timeout_increment_milliseconds, type=INT64, convertedtype=UINT_64"` + // P26 CAP-77 frozen ledger keys + FrozenLedgerKeys string `parquet:"name=frozen_ledger_keys, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` + FrozenLedgerKeysToFreeze string `parquet:"name=frozen_ledger_keys_to_freeze, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` + FrozenLedgerKeysToUnfreeze string `parquet:"name=frozen_ledger_keys_to_unfreeze, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` + FreezeBypassTxs string `parquet:"name=freeze_bypass_txs, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` + FreezeBypassTxsToAdd string `parquet:"name=freeze_bypass_txs_to_add, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` + FreezeBypassTxsToRemove string `parquet:"name=freeze_bypass_txs_to_remove, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` LastModifiedLedger int64 `parquet:"name=last_modified_ledger, type=INT64, convertedtype=UINT_64"` LedgerEntryChange int64 `parquet:"name=ledger_entry_change, type=INT64, convertedtype=UINT_64"` Deleted bool `parquet:"name=deleted, type=BOOLEAN"`