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

feat(provider): implement account filtering #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 charts/akash-provider/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type: application
# Versions are expected to follow Semantic Versioning (https://semver.org/)

# Major version bit highlights the mainnet release (e.g. mainnet4 = 4.x.x, mainnet5 = 5.x.x, ...)
version: 11.5.2-rc2
version: 11.5.3-rc2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
15 changes: 14 additions & 1 deletion charts/akash-provider/scripts/price_script_generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# WARNING: the runtime of this script should NOT exceed 5 seconds! (Perhaps can be amended via AKASH_BID_PRICE_SCRIPT_PROCESS_TIMEOUT env variable)
# Requirements:
# curl jq bc mawk ca-certificates
# Version: February-04-2025
# Version: February-19-2025
set -o pipefail

# Example:
Expand All @@ -28,6 +28,19 @@ if ! [[ -z $WHITELIST_URL ]]; then
fi
fi

# Do not bid if the tenant address is in the list passed with FILTERED_ACCOUNTS_URL environment variable
if ! [[ -z $FILTERED_ACCOUNTS_URL ]]; then
FILTERED_ACCOUNTS=/tmp/price-script.filtered_accounts
if ! test $(find $FILTERED_ACCOUNTS -mmin -10 2>/dev/null); then
curl -o $FILTERED_ACCOUNTS -s --connect-timeout 3 --max-time 3 -- $FILTERED_ACCOUNTS_URL
fi

if grep -qw "$AKASH_OWNER" $FILTERED_ACCOUNTS; then
echo -n "$AKASH_OWNER is filtered" >&2
exit 1
fi
fi

function get_akt_price {
# cache AKT price for 60 minutes to reduce the API pressure as well as to slightly accelerate the bidding (+5s)
CACHE_FILE=/tmp/aktprice.cache
Expand Down
4 changes: 4 additions & 0 deletions charts/akash-provider/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ spec:
- name: WHITELIST_URL
value: "{{ .Values.whitelist_url }}"
{{- end }}
{{ if .Values.filtered_accounts_url }}
- name: FILTERED_ACCOUNTS_URL
value: "{{ .Values.filtered_accounts_url }}"
{{- end }}
{{ if .Values.debug_bid_script }}
- name: DEBUG_BID_SCRIPT
value: "{{ .Values.debug_bid_script }}"
Expand Down
Loading