Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/blockscout/blockscout int…
Browse files Browse the repository at this point in the history
…o sync-11-25-24
  • Loading branch information
pustovalov committed Dec 5, 2024
2 parents b53c371 + 228b8bf commit a788e07
Show file tree
Hide file tree
Showing 149 changed files with 3,852 additions and 2,456 deletions.
5 changes: 3 additions & 2 deletions .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# If you create your own checks, you must specify the source files for
# them here, so they can be loaded by Credo before running the analysis.
#
requires: [],
requires: ["apps/utils/lib/credo/**/*.ex"],
#
# If you want to enforce a style guide and need a more traditional linting
# experience, you can change `strict` to `true` below:
Expand Down Expand Up @@ -140,9 +140,10 @@
{Credo.Check.Refactor.AppendSingleItem},
{Credo.Check.Refactor.VariableRebinding},
{Credo.Check.Warning.MapGetUnsafePass},
{Credo.Check.Consistency.MultiAliasImportRequireUse}
{Credo.Check.Consistency.MultiAliasImportRequireUse},

# Custom checks can be created using `mix credo.gen.check`.
{Utils.Credo.Checks.CompileEnvUsage}
#
]
}
Expand Down
36 changes: 32 additions & 4 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ on:
- production-zksync
- staging-l2
paths-ignore:
- 'CHANGELOG.md'
- '**/README.md'
- 'docker/*'
- 'docker-compose/*'
- "CHANGELOG.md"
- "**/README.md"
- "docker/*"
- "docker-compose/*"
pull_request:
types: [opened, synchronize, reopened, labeled]
branches:
Expand Down Expand Up @@ -459,6 +459,34 @@ jobs:
- run: ./node_modules/.bin/jest
working-directory: apps/block_scout_web/assets

test_utils:
name: Utils Tests
runs-on: ubuntu-latest
needs: build-and-cache
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
- name: Restore Mix Deps Cache
uses: actions/cache/restore@v4
id: deps-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-
- working-directory: apps/utils
run: mix test

test_nethermind_mox_ethereum_jsonrpc:
strategy:
fail-fast: false
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/pre-release-arbitrum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
DISABLE_WEBAPP=false
API_V1_READ_METHODS_DISABLED=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_EXCHANGE_RATES_PERIOD=
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
ADMIN_PANEL_ENABLED=false
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -65,11 +58,6 @@ jobs:
linux/arm64/v8
build-args: |
DISABLE_API=true
DISABLE_WEBAPP=true
CACHE_EXCHANGE_RATES_PERIOD=
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
ADMIN_PANEL_ENABLED=false
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -87,11 +75,6 @@ jobs:
linux/arm64/v8
build-args: |
DISABLE_INDEXER=true
DISABLE_WEBAPP=true
CACHE_EXCHANGE_RATES_PERIOD=
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
ADMIN_PANEL_ENABLED=false
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -108,13 +91,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
DISABLE_WEBAPP=false
API_V1_READ_METHODS_DISABLED=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_EXCHANGE_RATES_PERIOD=
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -133,11 +109,6 @@ jobs:
linux/arm64/v8
build-args: |
DISABLE_API=true
DISABLE_WEBAPP=true
CACHE_EXCHANGE_RATES_PERIOD=
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
ADMIN_PANEL_ENABLED=false
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -156,11 +127,6 @@ jobs:
linux/arm64/v8
build-args: |
DISABLE_INDEXER=true
DISABLE_WEBAPP=true
CACHE_EXCHANGE_RATES_PERIOD=
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/publish-docker-image-for-arbitrum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -59,12 +52,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_API=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -81,12 +69,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_INDEXER=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -103,13 +86,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -127,12 +103,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_API=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand All @@ -150,12 +121,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_INDEXER=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=arbitrum
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/publish-docker-image-for-eth-sepolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
Expand All @@ -59,12 +52,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_API=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
Expand All @@ -81,12 +69,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_INDEXER=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
Expand All @@ -103,13 +86,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}-shrink-internal-txs
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
Expand All @@ -127,12 +103,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_API=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}-shrink-internal-txs
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
Expand All @@ -150,12 +121,7 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_INDEXER=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}-shrink-internal-txs
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
Expand Down
21 changes: 20 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ When contributing to the codebase, please adhere to the following naming convent

By following these conventions, we can maintain a clean and understandable codebase.


### API V2 Naming Convention

When contributing to the API v2, please adhere to the following naming conventions for response fields to ensure clarity and consistency:
Expand All @@ -83,3 +82,23 @@ When contributing to the API v2, please adhere to the following naming conventio
- The transaction hash should be returned as a hex string in the `transaction_hash` property.
- All fields that contain the "index" suffix should be returned as numbers.

## Compile time Environment Variables

When working with compile time environment variables in the codebase, follow these guidelines:

- Always use the `Utils.CompileTimeEnvHelper` module instead of direct `Application.compile_env/2` calls:

```elixir
# DO use this approach
use Utils.CompileTimeEnvHelper,
attribute_name: [:app, :test]

# Access the value using the module attribute
@attribute_name

# DON'T use this approach
Application.compile_env(:app, :test) # avoid direct compile_env calls
```

This approach provides faster compilation time and simplifies development and maintenance.

4 changes: 2 additions & 2 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### Bug Fixes

*Things you changed that fix bugs. If a fixes a bug, but in so doing adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should be added to Incompatible Changes below also.*
*Things you changed that fix bugs. If it fixes a bug, but in so doing adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should be added to Incompatible Changes below also.*

### Incompatible Changes

Expand All @@ -27,6 +27,6 @@
- [ ] If I added new functionality, I added tests covering it.
- [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
- [ ] I checked whether I should update the docs and did so by submitting a PR to [docs repository](https://github.com/blockscout/docs).
- [ ] If I added/changed/removed ENV var, I submitted a PR to [docs repository](https://github.com/blockscout/docs) to update the list of [env vars](https://github.com/blockscout/docs/blob/master/for-developers/information-and-settings/env-variables.md) and I updated the version to `master` in the Version column. If I removed variable, I added it to [Deprecated ENV Variables](https://github.com/blockscout/docs/blob/master/for-developers/information-and-settings/env-variables/deprecated-env-variables/README.md) page. After merging docs PR, changes will be reflected in these [pages](https://docs.blockscout.com/for-developers/information-and-settings/env-variables).
- [ ] If I added/changed/removed ENV var, I submitted a PR to [docs repository](https://github.com/blockscout/docs) to update the list of [env vars](https://github.com/blockscout/docs/blob/master/setup/env-variables/README.md) and I updated the version to `master` in the Version column. If I removed variable, I added it to [Deprecated ENV Variables](https://github.com/blockscout/docs/blob/master/setup/env-variables/deprecated-env-variables/README.md) page. After merging docs PR, changes will be reflected in these [pages](https://docs.blockscout.com/setup/env-variables).
- [ ] If I added new DB indices, I checked, that they are not redundant, with PGHero or other tools.
- [ ] If I added/removed chain type, I modified the Github CI matrix and PR labels accordingly.
Loading

0 comments on commit a788e07

Please sign in to comment.