Skip to content
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

all: Merge Horizon's Protocol 19 implementation into master #4340

Merged
merged 22 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fc8b9c8
all: Add Protocol 19 XDR and update StrKey to support Signed Payloads…
Shaptic Mar 18, 2022
5580e6e
Merge pull request #4299 from stellar/master
2opremio Mar 21, 2022
af1aaa0
Support new account fields for protocol-19. (#4294)
erika-sdf Mar 23, 2022
f6eca07
xdr, keypair: Add helpers to create CAP-40 decorated signatures (#4302)
Shaptic Mar 23, 2022
b6605cf
services/horizon: Update txsub queue to account for new CAP-21 precon…
2opremio Mar 24, 2022
67f991f
Uncomment StateVerifier test that generates account v3 extensions now…
erika-sdf Mar 24, 2022
649016c
txnbuild: Add support for new CAP-21 preconditions. (#4303)
Shaptic Mar 25, 2022
9fdd7ff
services/horizon: Support new CAP-21 transaction conditions (#4297)
Mar 25, 2022
6d0f666
txnbuild: Complete rename, avoid using XDR types in `TransactionParam…
Shaptic Mar 25, 2022
da091b1
all: Update Protocol 19 XDR to the latest (#4308)
Shaptic Mar 26, 2022
f943540
Merge pull request #4315 from stellar/master
2opremio Apr 4, 2022
b5ca7f4
horizon: Set up protocol 19 integration tests infrastructure (#4312)
2opremio Apr 4, 2022
45b6f52
horizon: Test new protocol 19 account fields (#4322)
2opremio Apr 6, 2022
f009dcb
#4305: Add integration test for extra signers using tx preconditions
sreuland Apr 11, 2022
b9ee067
horizon: Add transaction submission test for Protocol 19 (#4327)
2opremio Apr 12, 2022
f22bc32
#4305: added integration tests for remaining preconditions
sreuland Apr 12, 2022
7cd3256
Merge pull request #4332 from sreuland/p19_precondition_tests
sreuland Apr 13, 2022
55ab073
services/horizon: Use `bigint` over `timestamp` to accommodate large …
Shaptic Apr 14, 2022
4dd082b
services/horizon: Change `min_account_sequence_age` column from `bigi…
Shaptic Apr 15, 2022
24e64d8
Align casing with the rest of the codebase
Shaptic Apr 19, 2022
13f957a
Add changelog details and prep v10.0.0 SDK release
Shaptic Apr 19, 2022
911b0e1
Merge branch 'master' into horizon-protocol-19
Shaptic Apr 19, 2022
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
24 changes: 16 additions & 8 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
go: [1.17, 1.18]
pg: [9.6.5]
ingestion-backend: [db, captive-core, captive-core-remote-storage]
captive-core: [18.5.0-873.rc1.d387c6a71.focal]
protocol-version: [18, 19]
runs-on: ${{ matrix.os }}
services:
postgres:
Expand All @@ -32,7 +32,12 @@ jobs:
ports:
- 5432:5432
env:
HORIZON_INTEGRATION_TESTS: "true"
HORIZON_INTEGRATION_TESTS_ENABLED: true
HORIZON_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL: ${{ matrix.protocol-version }}
PROTOCOL_19_CORE_DEBIAN_PKG_VERSION: 18.4.1-875.95d896a49.focal~v19unsafe
PROTOCOL_19_CORE_DOCKER_IMG: stellar/stellar-core:18.4.1-875.95d896a49.focal-v19unsafe
PROTOCOL_18_CORE_DEBIAN_PKG_VERSION: 18.5.0-873.rc1.d387c6a71.focal
PROTOCOL_18_CORE_DOCKER_IMG: stellar/stellar-core:18.5.0-873.rc1.d387c6a71.focal
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
Expand Down Expand Up @@ -61,8 +66,11 @@ jobs:
with:
go-version: ${{ matrix.go }}

- name: Pull latest Stellar Core image
run: docker pull stellar/stellar-core
- name: Pull and set Stellar Core image
shell: bash
run: |
docker pull "$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG"
echo HORIZON_INTEGRATION_TESTS_DOCKER_IMG="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG" >> $GITHUB_ENV

- if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }}
name: Install and enable Captive Core
Expand All @@ -74,14 +82,14 @@ jobs:

sudo wget -qO - https://apt.stellar.org/SDF.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true sudo apt-key add -
sudo bash -c 'echo "deb https://apt.stellar.org focal unstable" > /etc/apt/sources.list.d/SDF-unstable.list'
sudo apt-get update && sudo apt-get install -y stellar-core=${{ matrix.captive-core }}
sudo apt-get update && sudo apt-get install -y stellar-core="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DEBIAN_PKG_VERSION"
echo "Using stellar core version $(stellar-core version)"
echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE=true' >> $GITHUB_ENV
echo 'CAPTIVE_CORE_BIN=/usr/bin/stellar-core' >> $GITHUB_ENV
echo 'HORIZON_INTEGRATION_TESTS_ENABLE_CAPTIVE_CORE=true' >> $GITHUB_ENV
echo 'HORIZON_INTEGRATION_TESTS_CAPTIVE_CORE_BIN=/usr/bin/stellar-core' >> $GITHUB_ENV

- if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }}
name: Setup Captive Core Remote Storage
run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV
run: echo 'HORIZON_INTEGRATION_TESTS_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV

- run: go test -race -timeout 25m -v ./services/horizon/internal/integration/...

Expand Down
4 changes: 2 additions & 2 deletions clients/horizonclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,10 @@ func (c *Client) StreamOrderBooks(ctx context.Context, request OrderBookRequest,
// It defaults to localtime when the server time is not available.
// Note that this will generate your timebounds when you init the transaction, not when you build or submit
// the transaction! So give yourself enough time to get the transaction built and signed before submitting.
func (c *Client) FetchTimebounds(seconds int64) (txnbuild.Timebounds, error) {
func (c *Client) FetchTimebounds(seconds int64) (txnbuild.TimeBounds, error) {
serverURL, err := url.Parse(c.HorizonURL)
if err != nil {
return txnbuild.Timebounds{}, errors.Wrap(err, "unable to parse horizon url")
return txnbuild.TimeBounds{}, errors.Wrap(err, "unable to parse horizon url")
}
currentTime := currentServerTime(serverURL.Hostname(), c.clock.Now().UTC().Unix())
if currentTime != 0 {
Expand Down
10 changes: 5 additions & 5 deletions clients/horizonclient/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ func ExampleClient_SubmitFeeBumpTransaction() {
IncrementSequenceNum: false,
Operations: []txnbuild.Operation{&op},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewInfiniteTimeout(), // Use a real timeout in production!
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production!
},
)
if err != nil {
Expand Down Expand Up @@ -1154,7 +1154,7 @@ func ExampleClient_SubmitFeeBumpTransactionWithOptions() {
IncrementSequenceNum: false,
Operations: []txnbuild.Operation{&op},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewInfiniteTimeout(), // Use a real timeout in production!
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production!
},
)
if err != nil {
Expand Down Expand Up @@ -1211,7 +1211,7 @@ func ExampleClient_SubmitTransaction() {
IncrementSequenceNum: false,
Operations: []txnbuild.Operation{&op},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewInfiniteTimeout(), // Use a real timeout in production!
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production!
},
)
if err != nil {
Expand Down Expand Up @@ -1253,7 +1253,7 @@ func ExampleClient_SubmitTransactionWithOptions() {
IncrementSequenceNum: false,
Operations: []txnbuild.Operation{&op},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewInfiniteTimeout(), // Use a real timeout in production!
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production!
},
)
if err != nil {
Expand Down Expand Up @@ -1295,7 +1295,7 @@ func ExampleClient_SubmitTransactionWithOptions_skip_memo_required_check() {
IncrementSequenceNum: false,
Operations: []txnbuild.Operation{&op},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewInfiniteTimeout(), // Use a real timeout in production!
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production!
},
)
if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions clients/horizonclient/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func TestCheckMemoRequired(t *testing.T) {
IncrementSequenceNum: true,
Operations: tc.operations,
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
tt.NoError(err)
Expand Down Expand Up @@ -878,7 +878,7 @@ func TestSubmitTransactionRequest(t *testing.T) {
IncrementSequenceNum: true,
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -946,7 +946,7 @@ func TestSubmitTransactionRequestMuxedAccounts(t *testing.T) {
IncrementSequenceNum: true,
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -1006,7 +1006,7 @@ func TestSubmitFeeBumpTransaction(t *testing.T) {
IncrementSequenceNum: true,
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -1075,7 +1075,7 @@ func TestSubmitTransactionWithOptionsRequest(t *testing.T) {
IncrementSequenceNum: true,
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -1168,7 +1168,7 @@ func TestSubmitTransactionWithOptionsRequest(t *testing.T) {
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Memo: txnbuild.MemoText("HelloWorld"),
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -1202,7 +1202,7 @@ func TestSubmitFeeBumpTransactionWithOptions(t *testing.T) {
IncrementSequenceNum: true,
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -1293,7 +1293,7 @@ func TestSubmitFeeBumpTransactionWithOptions(t *testing.T) {
Operations: []txnbuild.Operation{&payment},
BaseFee: txnbuild.MinBaseFee,
Memo: txnbuild.MemoText("HelloWorld"),
Timebounds: txnbuild.NewTimebounds(0, 10),
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)},
},
)
assert.NoError(t, err)
Expand Down Expand Up @@ -1483,7 +1483,7 @@ func TestFetchTimebounds(t *testing.T) {
ServerTimeMap["localhost"] = newRecord
st, err = client.FetchTimebounds(100)
assert.NoError(t, err)
assert.IsType(t, st, txnbuild.Timebounds{})
assert.IsType(t, st, txnbuild.TimeBounds{})
assert.Equal(t, st.MinTime, int64(0))
// time should be 200, serverTime + 100seconds
assert.Equal(t, st.MaxTime, int64(200))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedButSigningAddressInvalid(
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -411,8 +411,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedOtherSignerSelected(t *te
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -477,8 +477,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxSourceAccountValid(t *t
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -544,8 +544,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxAndOpSourceAccountValid
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -610,8 +610,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxSourceAccountInvalid(t
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -673,8 +673,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedOpSourceAccountInvalid(t
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -737,8 +737,8 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxAndOpSourceAccountInval
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -806,8 +806,8 @@ func TestAccountSign_signingAddressPhoneNumberOwnerAuthenticated(t *testing.T) {
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -878,8 +878,8 @@ func TestAccountSign_signingAddressPhoneNumberOtherAuthenticated(t *testing.T) {
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -950,8 +950,8 @@ func TestAccountSign_signingAddressEmailOwnerAuthenticated(t *testing.T) {
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -1031,8 +1031,8 @@ func TestAccountSign_signingAddressEmailOwnerAuthenticatedOpSourceAccountIsAllow
},
&txnbuild.EndSponsoringFutureReserves{},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -1108,8 +1108,8 @@ func TestAccountSign_signingAddressEmailOwnerAuthenticatedOpSourceAccountInvalid
},
&txnbuild.EndSponsoringFutureReserves{},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -1175,8 +1175,8 @@ func TestAccountSign_signingAddressEmailOtherAuthenticated(t *testing.T) {
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -1281,8 +1281,8 @@ func TestAccountSign_signingAddressRejectsFeeBumpTx(t *testing.T) {
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down Expand Up @@ -1351,8 +1351,8 @@ func TestAccountSign_signingAddressValidContentTypeForm(t *testing.T) {
},
},
},
BaseFee: txnbuild.MinBaseFee,
Timebounds: txnbuild.NewTimebounds(0, 1),
BaseFee: txnbuild.MinBaseFee,
Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)},
},
)
require.NoError(t, err)
Expand Down
8 changes: 5 additions & 3 deletions exp/services/webauth/internal/serve/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,11 @@ func TestToken_jsonInputNoWebAuthDomainSuccess(t *testing.T) {
Value: []byte("ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg"),
},
},
BaseFee: txnbuild.MinBaseFee,
Memo: nil,
Timebounds: txnbuild.NewTimebounds(txMinTimebounds, txMaxTimebounds),
BaseFee: txnbuild.MinBaseFee,
Memo: nil,
Preconditions: txnbuild.Preconditions{
TimeBounds: txnbuild.NewTimebounds(txMinTimebounds, txMaxTimebounds),
},
},
)
require.NoError(t, err)
Expand Down
Loading