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

Move AA service urls to network table #430

Merged
merged 7 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start from golang base image
FROM golang:1.22.11-bullseye
FROM golang:1.23.0-bullseye

# Install the air binary
RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start from golang base image
FROM golang:1.22.11-alpine3.21 as builder
FROM golang:1.23-alpine3.21 as builder

# Install git.
RUN apk update && apk add --no-cache git
Expand Down
24 changes: 0 additions & 24 deletions config/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ type OrderConfiguration struct {
RefundCancellationCount int
PercentDeviationFromExternalRate decimal.Decimal
PercentDeviationFromMarketRate decimal.Decimal
BundlerUrlEthereum string
PaymasterUrlEthereum string
BundlerUrlPolygon string
PaymasterUrlPolygon string
BundlerUrlBase string
PaymasterUrlBase string
BundlerUrlBSC string
PaymasterUrlBSC string
BundlerUrlArbitrum string
PaymasterUrlArbitrum string
ActiveAAService string
}

// OrderConfig sets the order configuration
Expand All @@ -45,25 +34,12 @@ func OrderConfig() *OrderConfiguration {
viper.SetDefault("NETWORK_FEE", 0.05)
viper.SetDefault("PERCENT_DEVIATION_FROM_EXTERNAL_RATE", 0.01)
viper.SetDefault("PERCENT_DEVIATION_FROM_MARKET_RATE", 0.1)
viper.SetDefault("ACTIVE_AA_SERVICE", "stackup")

return &OrderConfiguration{
OrderFulfillmentValidity: time.Duration(viper.GetInt("ORDER_FULFILLMENT_VALIDITY")) * time.Minute,
OrderRefundTimeout: time.Duration(viper.GetInt("ORDER_REFUND_TIMEOUT")) * time.Minute,
ReceiveAddressValidity: time.Duration(viper.GetInt("RECEIVE_ADDRESS_VALIDITY")) * time.Minute,
OrderRequestValidity: time.Duration(viper.GetInt("ORDER_REQUEST_VALIDITY")) * time.Second,
TronProApiKey: viper.GetString("TRON_PRO_API_KEY"),
ActiveAAService: viper.GetString("ACTIVE_AA_SERVICE"),
BundlerUrlEthereum: viper.GetString("BUNDLER_URL_ETHEREUM"),
PaymasterUrlEthereum: viper.GetString("PAYMASTER_URL_ETHEREUM"),
BundlerUrlPolygon: viper.GetString("BUNDLER_URL_POLYGON"),
PaymasterUrlPolygon: viper.GetString("PAYMASTER_URL_POLYGON"),
BundlerUrlBase: viper.GetString("BUNDLER_URL_BASE"),
PaymasterUrlBase: viper.GetString("PAYMASTER_URL_BASE"),
BundlerUrlBSC: viper.GetString("BUNDLER_URL_BSC"),
PaymasterUrlBSC: viper.GetString("PAYMASTER_URL_BSC"),
BundlerUrlArbitrum: viper.GetString("BUNDLER_URL_ARBITRUM"),
PaymasterUrlArbitrum: viper.GetString("PAYMASTER_URL_ARBITRUM"),
EntryPointContractAddress: common.HexToAddress(viper.GetString("ENTRY_POINT_CONTRACT_ADDRESS")),
BucketQueueRebuildInterval: viper.GetInt("BUCKET_QUEUE_REBUILD_INTERVAL"),
RefundCancellationCount: viper.GetInt("REFUND_CANCELLATION_COUNT"),
Expand Down
2 changes: 2 additions & 0 deletions ent/migrate/migrations/20250220014823_aa_to_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "networks" table
ALTER TABLE "networks" ADD COLUMN "bundler_url" character varying NULL, ADD COLUMN "paymaster_url" character varying NULL;
3 changes: 2 additions & 1 deletion ent/migrate/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:0TorEmKfcV3nUsITm2cbp5Yv14Y/YkjEuBOXQsvpcH4=
h1:dR+GjJoPfeuDFy3ZE8clPJfTvnRV/Q1LPkeT1nxVxJ4=
20240118234246_initial.sql h1:dYuYBqns33WT+3p8VQvbKUP62k3k6w6h8S+FqNqgSvU=
20240130122324_order_from_address.sql h1:mMVI2iBUd1roIYLUqu0d2jZ7+B6exppRN8qqn+aIHx4=
20240202010744_fees_on_order.sql h1:P7ngxZKqDKefBM5vk6M3kbWeMPVwbZ4MZVcLBjEfS34=
Expand Down Expand Up @@ -43,3 +43,4 @@ h1:0TorEmKfcV3nUsITm2cbp5Yv14Y/YkjEuBOXQsvpcH4=
20241011010524_linked_addresses.sql h1:JvCXlyrRTwXqYPwz5YoGoh+/KEaGiswxmRp//wyxyhU=
20241226183354_add_reference.sql h1:oS3oVJcfD6q7EvDQrTWudCEf3HjBm/yI8XTlPvGqLC8=
20250205002723_lof_optional_txid.sql h1:Ew1wBRx/K1cBIA//BAOjReVJW11idWCIkLnuaF8FdXY=
20250220014823_aa_to_db.sql h1:pqbdJZe7CXgXI7ak+ggHUhjncM7l5Kiw02S4N/hqCXU=
2 changes: 2 additions & 0 deletions ent/migrate/schema.go

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

148 changes: 147 additions & 1 deletion ent/mutation.go

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

24 changes: 23 additions & 1 deletion ent/network.go

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

16 changes: 16 additions & 0 deletions ent/network/network.go

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

Loading
Loading