Skip to content

Commit

Permalink
soroban-rpc: Remove panics from internal codebase (#1167)
Browse files Browse the repository at this point in the history
* Remove panic - 1

* Remove panic - 2

* Remove panic - 3

* Remove panic - 4

* Small changes - 1

* undo changes in Get() func

* undo changes - 2

* undo changes - 3

* add test for append error

(cherry picked from commit b6671e2)
  • Loading branch information
2opremio authored and stellarsaur committed Feb 5, 2024
1 parent 7d8e2a6 commit 651e6e9
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/soroban-rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
env:
SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true
SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 20.1.0-1656.114b833e7.focal
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 20.2.0-1716.rc3.34d82fc00.focal
steps:
- uses: actions/checkout@v3
with:
Expand Down
69 changes: 36 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ default-members = ["cmd/crates/soroban-test"]
exclude = ["cmd/crates/soroban-test/tests/fixtures/hello"]

[workspace.package]
version = "20.2.0"
version = "20.3.0"
rust-version = "1.74.0"

[workspace.dependencies.soroban-env-host]
version = "=20.1.0"
version = "=20.2.0"
git = "https://github.com/stellar/rs-soroban-env"
rev = "36d33cb6c986c9a8a9200b7eb04cf02e2c3f0ef4"
rev = "1bfc0f2a2ee134efc1e1b0d5270281d0cba61c2e"
# path = "../rs-soroban-env/soroban-env-host"

[workspace.dependencies.soroban-simulation]
version = "=20.1.0"
version = "=20.2.0"
git = "https://github.com/stellar/rs-soroban-env"
rev = "36d33cb6c986c9a8a9200b7eb04cf02e2c3f0ef4"
rev = "1bfc0f2a2ee134efc1e1b0d5270281d0cba61c2e"
# path = "../rs-soroban-env/soroban-simulation"

[workspace.dependencies.soroban-spec]
version = "=20.1.0"
version = "=20.3.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "e6c2c900ab82b5f6eec48f69cb2cb519e19819cb"
rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de"
# path = "../rs-soroban-sdk/soroban-spec"

[workspace.dependencies.soroban-spec-rust]
version = "=20.1.0"
version = "=20.3.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "e6c2c900ab82b5f6eec48f69cb2cb519e19819cb"
rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de"
# path = "../rs-soroban-sdk/soroban-spec-rust"

[workspace.dependencies.soroban-spec-json]
Expand All @@ -53,27 +53,27 @@ git = "https://github.com/stellar/soroban-tools"
rev = "7ee51fa731aa21365363aef687bae6040b81aa7a"

[workspace.dependencies.soroban-sdk]
version = "=20.1.0"
version = "=20.3.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "e6c2c900ab82b5f6eec48f69cb2cb519e19819cb"
rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de"

[workspace.dependencies.soroban-token-sdk]
version = "=20.1.0"
version = "=20.3.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "e6c2c900ab82b5f6eec48f69cb2cb519e19819cb"
rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de"

[workspace.dependencies.soroban-ledger-snapshot]
version = "=20.1.0"
version = "=20.3.0"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "e6c2c900ab82b5f6eec48f69cb2cb519e19819cb"
rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de"

[workspace.dependencies.soroban-cli]
version = "20.2.0"
git = "https://github.com/stellar/soroban-tools"
rev = "6a19e181a5699c33b409f1c39f6fdc6b784769e0"

[workspace.dependencies.stellar-xdr]
version = "=20.0.2"
version = "=20.1.0"
default-features = true

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func MustNew(cfg *config.Config) *Daemon {
}
historyArchive, err := historyarchive.Connect(
cfg.HistoryArchiveURLs[0],
historyarchive.ConnectOptions{
historyarchive.ArchiveOptions{
CheckpointFrequency: cfg.CheckpointFrequency,
},
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
# Note: Please keep the image pinned to an immutable tag matching the Captive Core version.
# This avoids implicit updates which break compatibility between
# the Core container and captive core.
image: ${CORE_IMAGE:-stellar/unsafe-stellar-core:20.1.0-1656.114b833e7.focal}
image: ${CORE_IMAGE:-stellar/unsafe-stellar-core:20.2.0-1716.rc3.34d82fc00.focal}
depends_on:
- core-postgres
restart: on-failure
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/lib/preflight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ libc = "0.2.147"
sha2 = { workspace = true }
# we need the testutils feature in order to get backtraces in the preflight library
# when soroban rpc is configured to run with --preflight-enable-debug
soroban-env-host = { workspace = true, features = ["recording_auth", "testutils"]}
soroban-env-host = { workspace = true, features = ["recording_mode", "testutils"]}
soroban-simulation = { workspace = true }
36 changes: 30 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,30 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stellar/go v0.0.0-20240109175136-3ca501f09055
github.com/stellar/go v0.0.0-20240202231803-b0df9f046eb4
github.com/stretchr/testify v1.8.4
golang.org/x/mod v0.13.0
gotest.tools/v3 v3.5.0
)

require (
cloud.google.com/go v0.111.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/cloudflare/circl v1.3.5 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
Expand All @@ -37,8 +50,19 @@ require (
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/api v0.149.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/grpc v1.60.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

Expand Down Expand Up @@ -85,13 +109,13 @@ require (
github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/tylerb/graceful.v1 v1.2.15 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 651e6e9

Please sign in to comment.