-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
soroban-rpc: preflight: remove key sizes from read_bytes computation #922
soroban-rpc: preflight: remove key sizes from read_bytes computation #922
Conversation
Core stopped including including them
This has unveiled yet another envelope: The soroban transaction data is the following. My guess is that we are not accounting for the written expiration entries. I will try to fix that. |
Now, thinking about it, the write_bytes couldn't be the problem since they were already 0 before this PR. Something else is amiss. |
60de49c
to
c38a1e5
Compare
If you set |
The serialized length of an expiration ledger entry is 48, and not 36. This explains the missing 12 bytes :S I noticed that |
To be more specific. This prints 48: entry2 := xdr.LedgerEntry{
LastModifiedLedgerSeq: 4,
Data: xdr.LedgerEntryData{
Type: xdr.LedgerEntryTypeExpiration,
Expiration: &xdr.ExpirationEntry{
KeyHash: xdr.Hash{},
ExpirationLedgerSeq: 0,
},
},
Ext: xdr.LedgerEntryExt{},
}
bin, err := entry.MarshalBinary()
assert.NoError(t, err)
fmt.Println(len(bin)) whereas the Rust code reads /// Estimate for any `ExpirationEntry` ledger entry, consisting of a 32-byte
/// hash of the corresponding entry and 4 bytes for expiration ledger.
const EXPIRATION_ENTRY_SIZE: u32 = 32 + 4; The calculation above didn't take into account the ledger entry type nor the |
fcfe0e8
to
592d60d
Compare
We still need to update the sdk and soroban-env with the upstream fix once this merges |
Core stopped including including them
Followup from #913 (comment)