Skip to content

Commit

Permalink
Pass latestLedger+1 to the host
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Aug 8, 2023
1 parent f018073 commit dcb79ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/soroban-rpc/internal/preflight/preflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ func getInvokeHostFunctionPreflight(params PreflightParameters) (Preflight, erro
}

stateExpiration := stateExpirationConfig.Data.MustConfigSetting().MustStateExpirationSettings()
// It's of utmost importance to simulate the transactions like we were on the next ledger.
// Otherwise, users would need to wait for an extra ledger to close in order to observe the effects of the latest ledger
// transaction submission.
sequenceNumber := latestLedger + 1
li := C.CLedgerInfo{
network_passphrase: C.CString(params.NetworkPassphrase),
sequence_number: C.uint32_t(latestLedger),
sequence_number: C.uint32_t(sequenceNumber),
protocol_version: 20,
timestamp: C.uint64_t(time.Now().Unix()),
// Current base reserve is 0.5XLM (in stroops)
Expand Down

0 comments on commit dcb79ce

Please sign in to comment.