Skip to content

Commit 1b3b249

Browse files
committed
Merge
2 parents 4429324 + 9658154 commit 1b3b249

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1678
-671
lines changed

.github/workflows/lint.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@ jobs:
2121
- name: Run pre-commit checks
2222
run: |
2323
nix develop -c sh -c "pre-commit run --hook-stage pre-commit --show-diff-on-failure --color=always"
24+
25+
clean-go-mods:
26+
name: Clean go mods
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Set up Go 1.23.3
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version: '1.23.3'
33+
- name: Install gomods
34+
run: go install github.com/jmank88/[email protected]
35+
- name: Check out code
36+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
37+
- name: Run gomods tidy
38+
run: gomods tidy
39+
- name: Ensure clean after tidy
40+
run: |
41+
git add --all
42+
git diff --minimal --cached --exit-code
43+
2444
tools:
2545
name: Get tool-versions
2646
runs-on: ubuntu-latest

.github/workflows/rc-breaking-changes.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ jobs:
2525
go install golang.org/x/exp/cmd/gorelease@latest
2626
- name: Run Breaking Changes Script
2727
run: |
28-
go run ./tools/breakingchanges/cmd/main.go --ignore tools
28+
cd ./tools/breakingchanges
29+
go mod tidy
30+
go run cmd/main.go --ignore tools --root ../../

.github/workflows/release-go-module.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
fi
5252
5353
# Extract the version part of the last tag
54-
LAST_TAG_VERSION="${LAST_TAG##*/}"
54+
LAST_TAG_VERSION="${LAST_TAG##*/}"
5555
echo "Last tag version: $LAST_TAG_VERSION"
5656
echo "LAST_TAG_VERSION=${LAST_TAG_VERSION}" >> "$GITHUB_ENV"
5757

.nancy-ignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ CVE-2024-32972 # CWE-400: Uncontrolled Resource Consumption ('Resource Exhaustio
1313
CVE-2023-42319 # CWE-noinfo: lol... go-ethereum v1.13.8 again
1414
CVE-2024-10086 # Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
1515
CVE-2024-51744 # CWE-755: Improper Handling of Exceptional Conditions
16-
CVE-2024-45338 # CWE-770: Allocation of Resources Without Limits or Throttling
16+
CVE-2024-45338 # CWE-770: Allocation of Resources Without Limits or Throttling
17+
CVE-2024-45337 # CWE-863: Incorrect Authorization in golang.org/x/[email protected]

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
- [Custom Prometheus metrics](./libs/wasp/benchspy/prometheus_custom.md)
8181
- [To Loki or not to Loki?](./libs/wasp/benchspy/loki_dillema.md)
8282
- [Real world example](./libs/wasp/benchspy/real_world.md)
83+
- [Debugging](./libs/wasp/benchspy/debugging.md)
8384
- [Reports](./libs/wasp/benchspy/reports/overview.md)
8485
- [Standard Report](./libs/wasp/benchspy/reports/standard_report.md)
8586
- [Adding new QueryExecutor](./libs/wasp/benchspy/reports/new_executor.md)

book/src/libs/seth.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Reliable and debug-friendly Ethereum client
7070
- [ ] Tracing support (prestate)
7171
- [x] Tracing decoding
7272
- [x] Tracing tests
73-
- [ ] More tests for corner cases of decoding/tracing
73+
- [x] More tests for corner cases of decoding/tracing
7474
- [x] Saving of deployed contracts mapping (`address -> ABI_name`) for live networks
7575
- [x] Reading of deployed contracts mappings for live networks
7676
- [x] Automatic gas estimator (experimental)
@@ -233,7 +233,9 @@ client, err := NewClientBuilder().
233233
// EIP-1559 and gas estimations
234234
WithEIP1559DynamicFees(true).
235235
WithDynamicGasPrices(120_000_000_000, 44_000_000_000).
236-
WithGasPriceEstimations(true, 10, seth.Priority_Fast).
236+
// estimate gas prices based on the information from the RPC based on 10 last blocks
237+
// adjust the value to fast priority and 3 attempts to get the estimations
238+
WithGasPriceEstimations(true, 10, seth.Priority_Fast, 3).
237239
// gas bumping: retries, max gas price, bumping strategy function
238240
WithGasBumping(5, 100_000_000_000, PriorityBasedGasBumpingStrategyFn).
239241
Build()
@@ -441,6 +443,8 @@ For real networks, the estimation process differs for legacy transactions and th
441443
5. **Final Fee Calculation**: Sum the base fee and adjusted tip to set the `gas_fee_cap`.
442444
6. **Congestion Buffer**: Similar to legacy transactions, analyze congestion and apply a buffer to both the fee cap and the tip to secure transaction inclusion.
443445

446+
Regardless of transaction type, if fetching data from RPC or calculating prices fails due to any issue and `gas_price_estimation_attempt_count` is > 1 we will retry it N-1 number of times.
447+
444448
Understanding and setting these parameters correctly ensures that your transactions are processed efficiently and cost-effectively on the network.
445449

446450
When fetching historical base fee and tip data, we will use the last `gas_price_estimation_blocks` blocks. If it's set to `0` we will default to `100` last blocks. If the blockchain has less than `100` blocks we will use all of them.
@@ -492,6 +496,14 @@ case Congestion_VeryHigh:
492496
For low congestion rate we will increase gas price by 10%, for medium by 20%, for high by 30% and for very high by 40%. We cache block header data in an in-memory cache, so we don't have to fetch it every time we estimate gas. The cache has capacity equal to `gas_price_estimation_blocks` and every time we add a new element, we remove one that is least frequently used and oldest (with block number being a constant and chain always moving forward it makes no sense to keep old blocks). It's important to know that in order to use congestion metrics we need to fetch at least 80% of the requested blocks. If that fails, we will skip this part of the estimation and only adjust the gas price based on priority.
493497
For both transaction types if any of the steps fails, we fall back to hardcoded values.
494498

499+
##### Gas estimations attemps
500+
501+
If for any reason fetching gas price suggestions or fee history from the RPC fails, or subsequent calulation of percentiles fails, it can be retried. This behaviour is controlled by `gas_price_estimation_attempt_count`, which if empty or set to `0` will default to
502+
just one attempt, which means that if it fails, it won't be retried. Set it to `2` to allow a single retry, etc.
503+
504+
> [!NOTE]
505+
> To disable gas estimation set `gas_price_estimation_enabled` to `false`. Setting `gas_price_estimation_attempt_count` to `0` won't have such effect.
506+
495507
### DOT graphs
496508

497509
There are multiple ways of visualising DOT graphs:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# BenchSpy - Debugging
2+
3+
If you run into any issues with `BenchSpy` it might help to lower the default logging level to either `debug` or `trace`. It's controlled by environment variable called `BENCHSPY_LOG_LEVEL`.

book/src/libs/wasp/benchspy/getting_started.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ The following examples assume you have access to the following applications:
1111
1212
Since BenchSpy is tightly coupled with WASP, we highly recommend that you [get familiar with it first](../overview.md) if you haven't already.
1313

14-
Ready? [Let's get started!](./first_test.md)
14+
Ready? [Let's get started!](./first_test.md)
15+
16+
> [!NOTE]
17+
> You can `BENCHSPY_LOG_LEVEL` environment variable to control the log level.

book/src/libs/wasp/benchspy/real_world.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,17 @@ This function fetches the current report (for version passed as environment vari
8787
Let’s assume you want to ensure that none of the performance metrics degrade by more than **1%** between releases (and that error rate has not changed at all). Here's how you can write assertions using a convenient function for the `Direct` query executor:
8888

8989
```go
90-
hasErrors, errors := benchspy.CompareDirectWithThresholds(
90+
hasFailed, error := benchspy.CompareDirectWithThresholds(
9191
1.0, // Max 1% worse median latency
9292
1.0, // Max 1% worse p95 latency
9393
1.0, // Max 1% worse maximum latency
9494
0.0, // No increase in error rate
9595
currentReport, previousReport)
96-
require.False(t, hasErrors, fmt.Sprintf("errors found: %v", errors))
96+
require.False(t, hasError, fmt.Sprintf("issues found: %v", error))
9797
```
9898

99+
Error returned by this function is a concatenation of all threshold violations found for each standard metric and generator.
100+
99101
---
100102

101103
## Conclusion

framework/.changeset/v0.4.2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Name logs subdir as test name
2+
- Mutex for concurrent mock Record access
3+
- Remove Promtail only through CLI

0 commit comments

Comments
 (0)