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

Protocol 22 Breaking changes #280

Merged
merged 23 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2c74888
Use `TransactionInfo` within `GetTransactionResponse` (#251)
Shaptic Jul 19, 2024
61fa441
Merge branch 'main' into v22-breaking-changes
Shaptic Aug 19, 2024
b8a75a0
Merge branch 'main' into v22-breaking-changes
Shaptic Aug 19, 2024
30814ea
Merge branch 'main' into v22-breaking-changes
2opremio Aug 29, 2024
2daf023
Change API field naming style to Camel Case.
overcat May 9, 2024
b668361
itests: use `docker compose` if `docker-compose` is unavailable (#279)
2opremio Aug 30, 2024
7913265
Cleanup old retention window and upgrade history-retention-window (#277)
psheth9 Aug 30, 2024
e110732
Improve startup by eliminating unnecessary migration ranges (#282)
Shaptic Sep 4, 2024
918c978
Optimise db performance of `GetLedgerRange` (#256)
aditya1702 Sep 5, 2024
4203a0b
Fix lint error in /methods and remove usage of internal error package…
psheth9 Sep 9, 2024
d81c47f
Fix RPC linting (#286)
aditya1702 Sep 10, 2024
2aeb13c
Bump horizon to latest release tag (#290)
aditya1702 Sep 10, 2024
e51095a
Remove RELEASING.md (#292)
aditya1702 Sep 13, 2024
cfef393
Update `simulateTransaction` fields to properly omit fields when empt…
Shaptic Sep 14, 2024
b17d430
Update changelog with upcoming patch changes (#294)
Shaptic Sep 16, 2024
accd794
Merge branch 'main' into v22-breaking-changes
2opremio Sep 19, 2024
3bca89b
Add build-stellar-rpc in makefile (#296)
psheth9 Sep 19, 2024
b817750
simulate-transaction: remove confusing Cost field in response (#295)
2opremio Sep 20, 2024
cae1740
Add cursor in GetEventResponse (#287)
psheth9 Sep 20, 2024
e7debbe
Add hash to getTransactions response (#299)
aditya1702 Sep 24, 2024
953a504
Update docker file to build 2 images based on `BINARY_NAME` (#300)
psheth9 Sep 25, 2024
38807d3
Merge branch 'main' into v22-breaking-changes
psheth9 Sep 25, 2024
44db01f
Remove pagingToken from getEvents (#297)
psheth9 Oct 2, 2024
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

## Unreleased


## [v21.5.1](https://github.com/stellar/soroban-rpc/compare/v21.5.0...v21.5.1)

### Fixed
* Preserve field omission behavior of `simulateTransaction` ([#291](https://github.com/stellar/soroban-rpc/pull/291)).

## [v21.5.0](https://github.com/stellar/soroban-rpc/compare/v21.4.1...v21.5.0)

### Added

- Add `Cursor` in `GetEventsResponse`. This tells the client until what ledger events are being queried. e.g.: `startLEdger` (inclusive) - `endLedger` (exclusive)
- Limitation: getEvents are capped by 10K `LedgerScanLimit` which means you can query events for 10K ledger at maximum for a given request.
- Add `EndLedger` in `GetEventsRequest`. This provides finer control and clarity on the range of ledgers being queried.
- Disk-Based Event Storage: Events are now stored on disk instead of in memory. For context, storing approximately 3 million events will require around 1.5 GB of disk space.
This change enhances the scalability and can now support a larger retention window (~7 days) for events.
Expand Down
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ endif
# (libpreflight.a is put at target/release-with-panic-unwind/ when not cross compiling)
CARGO_BUILD_TARGET ?= $(shell rustc -vV | sed -n 's|host: ||p')

SOROBAN_RPC_BINARY := soroban-rpc
STELLAR_RPC_BINARY := stellar-rpc


# update the Cargo.lock every time the Cargo.toml changes.
Cargo.lock: Cargo.toml
cargo update --workspace
Expand Down Expand Up @@ -77,11 +81,19 @@ clean:
cargo clean
go clean ./...

# DEPRECATED - please use build-stellar-rpc instead
# the build-soroban-rpc build target is an optimized build target used by
# https://github.com/stellar/pipelines/stellar-horizon/Jenkinsfile-soroban-rpc-package-builder
# https://github.com/stellar/pipelines/blob/master/soroban-rpc/Jenkinsfile-soroban-rpc-package-builder
# as part of the package building.
build-soroban-rpc: build-libs
go build -ldflags="${GOLDFLAGS}" ${MACOS_MIN_VER} -o soroban-rpc -trimpath -v ./cmd/soroban-rpc
go build -ldflags="${GOLDFLAGS}" ${MACOS_MIN_VER} -o ${SOROBAN_RPC_BINARY} -trimpath -v ./cmd/soroban-rpc

# the build-stellar-rpc build target is an optimized build target used by
# https://github.com/stellar/pipelines/blob/master/soroban-rpc/Jenkinsfile-soroban-rpc-package-builder
# as part of the package building.
build-stellar-rpc: build-libs
go build -ldflags="${GOLDFLAGS}" ${MACOS_MIN_VER} -o ${STELLAR_RPC_BINARY} -trimpath -v ./cmd/soroban-rpc


go-check-branch:
golangci-lint run ./... --new-from-rev $$(git rev-parse origin/main)
Expand Down
58 changes: 0 additions & 58 deletions RELEASING.md

This file was deleted.

15 changes: 11 additions & 4 deletions cmd/soroban-rpc/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM golang:1.22-bullseye as build
ARG RUST_TOOLCHAIN_VERSION=stable
ARG REPOSITORY_VERSION
ARG BINARY_NAME=soroban-rpc

WORKDIR /go/src/github.com/stellar/soroban-rpc

Expand All @@ -18,11 +19,14 @@ RUN apt-get clean

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLCHAIN_VERSION

RUN make REPOSITORY_VERSION=${REPOSITORY_VERSION} build-soroban-rpc
RUN mv soroban-rpc /bin/soroban-rpc
RUN make REPOSITORY_VERSION=${REPOSITORY_VERSION} build-${BINARY_NAME}

# Move the binary to a common location
RUN mv ${BINARY_NAME} /bin/${BINARY_NAME}

FROM ubuntu:22.04
ARG STELLAR_CORE_VERSION
ARG BINARY_NAME=soroban-rpc
ENV STELLAR_CORE_VERSION=${STELLAR_CORE_VERSION:-*}
ENV STELLAR_CORE_BINARY_PATH /usr/bin/stellar-core
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -35,5 +39,8 @@ RUN echo "deb https://apt.stellar.org focal unstable" >/etc/apt/sources.list.d/S
RUN apt-get update && apt-get install -y stellar-core=${STELLAR_CORE_VERSION}
RUN apt-get clean

COPY --from=build /bin/soroban-rpc /app/
ENTRYPOINT ["/app/soroban-rpc"]
# Copy the binary from the build stage
COPY --from=build /bin/${BINARY_NAME} /app/${BINARY_NAME}

# Set the entrypoint to the specific binary
ENTRYPOINT ["/app/${BINARY_NAME}"]
12 changes: 11 additions & 1 deletion cmd/soroban-rpc/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ ifndef STELLAR_CORE_VERSION
$(error STELLAR_CORE_VERSION environment variable must be set. For example 19.10.1-1310.6649f5173.focal~soroban)
endif

TAG ?= stellar/stellar-soroban-rpc:$(SOROBAN_RPC_VERSION_PACKAGE_VERSION)
# Set default value for BINARY_NAME if not provided
BINARY_NAME ?= soroban-rpc

# Set the TAG based on the value of BINARY_NAME
ifeq ($(BINARY_NAME),stellar-rpc)
TAG := stellar/stellar-rpc:$(SOROBAN_RPC_VERSION_PACKAGE_VERSION)
else
TAG := stellar/stellar-soroban-rpc:$(SOROBAN_RPC_VERSION_PACKAGE_VERSION)
endif


docker-build:
$(SUDO) docker build --pull --platform linux/amd64 $(DOCKER_OPTS) \
--label org.opencontainers.image.created="$(BUILD_DATE)" \
--build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION) --build-arg SOROBAN_RPC_VERSION=$(SOROBAN_RPC_VERSION_PACKAGE_VERSION) \
--build-arg BINARY_NAME=$(BINARY_NAME) \
-t $(TAG) -f Dockerfile.release .

docker-push:
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/spf13/pflag"
)

// Init adds the CLI flags to the command. This lets the command output the
// AddFlags Init adds the CLI flags to the command. This lets the command output the
// flags as part of the --help output.
func (cfg *Config) AddFlags(cmd *cobra.Command) error {
cfg.flagset = cmd.PersistentFlags()
Expand Down
9 changes: 0 additions & 9 deletions cmd/soroban-rpc/internal/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type Config struct {
CoreRequestTimeout time.Duration
DefaultEventsLimit uint
DefaultTransactionsLimit uint
EventLedgerRetentionWindow uint32
FriendbotURL string
HistoryArchiveURLs []string
HistoryArchiveUserAgent string
Expand All @@ -42,7 +41,6 @@ type Config struct {
PreflightEnableDebug bool
SQLiteDBPath string
HistoryRetentionWindow uint32
TransactionLedgerRetentionWindow uint32
SorobanFeeStatsLedgerRetentionWindow uint32
ClassicFeeStatsLedgerRetentionWindow uint32
RequestBacklogGlobalQueueLimit uint
Expand Down Expand Up @@ -115,13 +113,6 @@ func (cfg *Config) SetValues(lookupEnv func(string) (string, bool)) error {
}
}

// Set to the maximum as a compromise until we deprecate the transaction/event flags
cfg.HistoryRetentionWindow = max(
cfg.HistoryRetentionWindow,
cfg.EventLedgerRetentionWindow,
cfg.TransactionLedgerRetentionWindow,
)

return nil
}

Expand Down
6 changes: 4 additions & 2 deletions cmd/soroban-rpc/internal/config/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ func TestLoadConfigPathPrecedence(t *testing.T) {
}))
require.NoError(t, cfg.Validate())

assert.Equal(t, "/opt/stellar/soroban-rpc/etc/stellar-captive-core.cfg", cfg.CaptiveCoreConfigPath, "should read values from the config path file")
assert.Equal(t, "/opt/stellar/soroban-rpc/etc/stellar-captive-core.cfg", cfg.CaptiveCoreConfigPath,
"should read values from the config path file")
assert.Equal(t, "CLI test passphrase", cfg.NetworkPassphrase, "cli flags should override --config-path values")
assert.Equal(t, "/usr/overridden/stellar-core", cfg.StellarCoreBinaryPath, "cli flags should override --config-path values and env vars")
assert.Equal(t, "/usr/overridden/stellar-core", cfg.StellarCoreBinaryPath,
"cli flags should override --config-path values and env vars")
assert.Equal(t, "/env/overridden/db", cfg.SQLiteDBPath, "env var should override config file")
assert.Equal(t, 2*time.Second, cfg.CoreRequestTimeout, "default value should be used, if not set anywhere else")
}
Expand Down
Loading
Loading