Skip to content

initial p26 updates#401

Open
hunterpack wants to merge 5 commits intomasterfrom
release-protocol-26
Open

initial p26 updates#401
hunterpack wants to merge 5 commits intomasterfrom
release-protocol-26

Conversation

@hunterpack
Copy link
Copy Markdown
Contributor

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with the jira ticket associated with the PR.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated the README with the added features, breaking changes, new instructions on how to use the repository. I updated the description of the fuction with the changes that were made.

Release planning

  • I've decided if this PR requires a new major/minor/patch version accordingly to
    semver, and I've changed the name of the BRANCH to major/_ , minor/_ or patch/* .

What

[TODO: Short statement about what is changing.]

Why

[TODO: Why this change is being made. Include any context required to understand the why.]

Known limitations

[TODO or N/A]

@hunterpack hunterpack requested a review from a team as a code owner April 6, 2026 19:55
Copilot AI review requested due to automatic review settings April 6, 2026 19:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Soroban config_settings transformation pipeline to include additional protocol config fields (P23) and CAP-77 “frozen ledger keys” fields (P26), ensuring they are emitted in both JSON and Parquet outputs.

Changes:

  • Added new P23 and P26 fields to the ConfigSettingOutput / ConfigSettingOutputParquet schemas.
  • Populated the new fields in TransformConfigSetting and mapped them through ToParquet().
  • Updated config-setting transform tests to include new P23 config setting IDs.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/transform/schema.go Adds new JSON fields to ConfigSettingOutput for P23/P26 config settings.
internal/transform/schema_parquet.go Adds matching Parquet schema fields for P23/P26 config settings.
internal/transform/parquet_converter.go Maps the new config-setting fields into the Parquet output struct.
internal/transform/config_setting.go Extracts new P23/P26 values and introduces serializers for CAP-77 fields.
internal/transform/config_setting_test.go Adds test fixtures/expectations for the new P23 config setting IDs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +252 to +256
// serializeFrozenKeysDelta converts a FrozenLedgerKeysDelta to a JSON object with keysToFreeze and keysToUnfreeze arrays.
func serializeFrozenKeysDelta(delta xdr.FrozenLedgerKeysDelta) string {
if len(delta.KeysToFreeze) == 0 && len(delta.KeysToUnfreeze) == 0 {
return ""
}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc comment for serializeFrozenKeysDelta mentions keysToFreeze/keysToUnfreeze, but the JSON output uses snake_case fields ("keys_to_freeze" / "keys_to_unfreeze"). Please align the comment with the actual output shape so consumers aren’t misled.

Copilot uses AI. Check for mistakes.
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 6, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​stellar/​go-stellar-sdk@​v0.0.0-20251211085638-ba09a6a91775 ⏵ v0.0.0-20260325174035-031e5bfdc4bd75 +1100100100100

View full report

Comment on lines +239 to +248
// serializeEncodedLedgerKeys converts a slice of EncodedLedgerKey (opaque bytes) to a JSON array of base64 strings.
func serializeEncodedLedgerKeys(keys []xdr.EncodedLedgerKey) string {
if len(keys) == 0 {
return ""
}
encoded := make([]string, 0, len(keys))
for _, key := range keys {
encoded = append(encoded, base64.StdEncoding.EncodeToString(key))
}
result, _ := json.Marshal(encoded)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a serialized string we might be better off as an array of strings ([]string).
And instead of encoding and marshaling like above you can use the xdr.MarshalBase64

An example of this can be found here

We can check if we are doing the marshaling and conversions correctly because these should all be real ledger keys as in we should be able to see the ledger key for the contract data or trustline or whatever like

Contract Data Ledger keys
* ABC123
* EFG456

Frozen Ledger Keys
* ABC123 -- this ledger key should be the same format as the ledger key above

Comment on lines +131 to +132
frozenLedgerKeysDelta, _ := configSetting.GetFrozenLedgerKeysDelta()
frozenLedgerKeysDeltaJSON := serializeFrozenKeysDelta(frozenLedgerKeysDelta)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend flattening this out so that you just have like frozenLedgerKeysToFreeze and frozenLedgerKeysToUnfreeze instead of a new map to hold both entries

For example in BigQuery this would just look like

select
  frozen_ledger_keys_to_freeze
  , frozen_ledger_keys_to_unfreeze

vs

select
  frozen_ledger_keys_delta.keys_to_freeze
  , frozen_ledger_keys_delta.keys_to_unfreeze

Comment on lines +137 to +138
freezeBypassTxsDelta, _ := configSetting.GetFreezeBypassTxsDelta()
freezeBypassTxsDeltaJSON := serializeFreezeBypassTxsDelta(freezeBypassTxsDelta)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same recommendation as https://github.com/stellar/stellar-etl/pull/401/changes#r3041684008

Flatten instead of making it a map

Comment on lines +273 to +283
func serializeHashes(hashes []xdr.Hash) string {
if len(hashes) == 0 {
return ""
}
encoded := make([]string, 0, len(hashes))
for _, h := range hashes {
encoded = append(encoded, hex.EncodeToString(h[:]))
}
result, _ := json.Marshal(encoded)
return string(result)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to https://github.com/stellar/stellar-etl/pull/401/changes#r3041658556

I think you can convert the hash to a transaction_hash like here

We would need to confirm the frozen/unfrozen tx hashes match actual tx hashing or whatever hashes == hashes we are comparing

Comment on lines +631 to +634
FrozenLedgerKeys string `json:"frozen_ledger_keys"`
FrozenLedgerKeysDelta string `json:"frozen_ledger_keys_delta"`
FreezeBypassTxs string `json:"freeze_bypass_txs"`
FreezeBypassTxsDelta string `json:"freeze_bypass_txs_delta"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update these to []string to work the the above suggested changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants