Skip to content

Commit a2e0ef2

Browse files
committed
Merge branch 'gregor/gasUpdate' into 'main'
priority tip update + repo files See merge request flarenetwork/FSP/flare-system-client!69
2 parents 5ae4e36 + 55ad5bb commit a2e0ef2

30 files changed

Lines changed: 725 additions & 476 deletions

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ stages:
88

99
variables:
1010
GOPATH: /go
11-
GOLANG_VERSION: "1.23-bookworm@sha256:167053a2bb901972bf2c1611f8f52c44d5fe7e762e5cab213708d82c421614db"
12-
GOLINT_VERSION: "v2.0.2"
11+
GOLANG_VERSION: "1.25.1-trixie@sha256:61226c61f37cb86253c4ac486ef22c47f14bfddb8f60bb4805bfc165001be758"
12+
GOLINT_VERSION: "v2.6.1"
1313

1414
cache:
1515
key: ${CI_COMMIT_REF_SLUG}
@@ -37,4 +37,4 @@ test:
3737
image: golang:${GOLANG_VERSION}
3838
needs: [build]
3939
script:
40-
- go test ./...
40+
- go test -timeout 5m ./...

.golangci.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,54 @@
11
version: "2"
22
run:
3-
go: 1.23.8
3+
go: "1.25.1"
44
modules-download-mode: readonly
55
linters:
66
default: standard
77
enable:
8-
- whitespace
8+
- asciicheck
9+
- bidichk
10+
- bodyclose
11+
- containedctx
12+
- copyloopvar
13+
- decorder
14+
- errchkjson
15+
- errname
16+
- exhaustive
17+
- exptostd
18+
- forcetypeassert
19+
- misspell
20+
- nolintlint
921
- unconvert
10-
exclusions:
11-
generated: lax
12-
presets:
13-
- comments
14-
- common-false-positives
15-
- legacy
16-
- std-error-handling
17-
paths:
18-
- third_party$
19-
- builtin$
20-
- examples$
22+
- whitespace
23+
24+
- modernize
25+
- thelper
26+
- usestdlibvars
27+
- usetesting
28+
- unparam
29+
- predeclared
30+
- prealloc
31+
32+
settings:
33+
exhaustive:
34+
default-signifies-exhaustive: true
35+
nolintlint:
36+
require-specific: true
37+
exclusions:
38+
generated: lax
39+
paths:
40+
- third_party$
41+
- builtin$
42+
- examples$
2143
formatters:
44+
enable:
45+
- gofmt
2246
exclusions:
2347
generated: lax
2448
paths:
2549
- third_party$
2650
- builtin$
2751
- examples$
52+
53+
issues:
54+
max-same-issues: 3

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Changelog
2+
3+
## [v1.0.6] - 2026-2-13
4+
5+
### Added
6+
7+
- SECURITY.md
8+
- CHANGELOG.md
9+
- CONTRIBUTING.md
10+
- CODEOWNERS
11+
12+
### Changed
13+
14+
- go version update
15+
- Config for gas for raw transactions
16+
- Type 2 is default
17+
- Removed:
18+
- MaxPriorityFeePerGas (max_priority_fee_per_gas)
19+
- Added:
20+
- MaxPriorityFeeMultiplier (max_priority_fee_multiplier) withe default 2
21+
- MaximalMaxPriorityFee (maximal_max_priority_fee) with default 5000 Gwei (5_000_000_000_000)
22+
- MinimalMaxPriorityFee (minimal_max_priority_fee) with default 100 Gwei (100_000_000_000)
23+
- For type 2, the MaxPriorityFee is set a product of MaxPriorityFeeMultiplier and estimation of the baseFee caped with MaximalMaxPriorityFee and MinimalMaxPriorityFee, respectively.
24+
- More aggressive gas settings for signingPolicy signing. Raised maximal number of transaction retries.
25+
- Dependency updates
26+
- README.md updates
27+
- Small refactors

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* andrius@flare.network gregor.podlogar@flare.network

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributing
2+
3+
Thank you for considering improving out source code.
4+
All contributions are welcome.
5+
6+
## Issues
7+
8+
_Sensitive security-related issues should not be reported publicly.
9+
See [Security](SECURITY.md)._
10+
11+
To share ideas, considerations, or concerned open an issue.
12+
Before filing an issue make sure the issue has not been already raised.
13+
In the issue, answer the following questions:
14+
15+
- What is the issue?
16+
- Why it is an issue?
17+
- How do you propose to change it?
18+
19+
### Pull request
20+
21+
Before opening a pull request open an issue on why the request is needed.
22+
23+
To contribute: fork the repo, make your improvements, commit, and open a pull request.
24+
The maintainers will review the request.
25+
26+
The request must:
27+
28+
- Reference the relevant issue,
29+
- Follow standard golang guidelines,
30+
- Be well documented,
31+
- Be well tested,
32+
- Compile,
33+
- Pass all the tests,
34+
- Pass all the linters,
35+
- Be based on opened against `main` branch.
36+
37+
## Setting the environment
38+
39+
Make sure you are using go with higher or equal version to the one specified in go.mod.
40+
41+
Get all the dependencies
42+
43+
```bash
44+
go mod tidy
45+
```
46+
47+
### Tests
48+
49+
Run unit tests with
50+
51+
```bash
52+
go test ./...
53+
```
54+
55+
### Linting
56+
57+
Run linters (make sure you have [golangci-lint](https://golangci-lint.run/) installed) with
58+
59+
```bash
60+
golangci-lint run
61+
```
62+
63+
The linting configs are specified in [.golangci.yml](.golangci.yml).
64+
65+
## AI Assistance
66+
67+
Any significant use of the AI assistance in the contribution MUST be disclosed in the pull request along with the extent of the use.
68+
69+
An example disclosure:
70+
71+
> This PR was written primarily by Claude Code.
72+
73+
Or a more detailed disclosure:
74+
75+
> I consulted ChatGPT for the following code snippets: ...

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# build executable
2-
FROM golang:1.23-bookworm@sha256:167053a2bb901972bf2c1611f8f52c44d5fe7e762e5cab213708d82c421614db AS builder
2+
FROM golang:1.25.1-trixie@sha256:61226c61f37cb86253c4ac486ef22c47f14bfddb8f60bb4805bfc165001be758 AS builder
33

44
WORKDIR /build
55

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Flare Foundation
3+
Copyright (c) 2026 Flare Foundation
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
<div align="center">
2+
<a href="https://flare.network/" target="blank">
3+
<img src="https://content.flare.network/Flare-2.svg" width="300" alt="Flare Logo" />
4+
</a>
5+
<br />
6+
<a href="CONTRIBUTING.md">Contributing</a>
7+
·
8+
<a href="SECURITY.md">Security</a>
9+
·
10+
<a href="CHANGELOG.md">Changelog</a>
11+
</div>
12+
113
# Flare Systems Protocol Client
214

315
...
416

17+
[![API Reference](https://pkg.go.dev/badge/github.com/flare-foundation/flare-system-client)](https://pkg.go.dev/github.com/flare-foundation/flare-system-client?tab=doc)
18+
519
## Configuration
620

721
The configuration is read from `toml` file. Some configuration
@@ -123,38 +137,53 @@ gas_limit = 0 # (optional) gas limit for transaction. D
123137
gas_price_multiplier = 0 # (optional for type 0 tx) sets the gas price to be a multiplier of the estimated gas price. Defaults to 0, which will simply use the estimate, OR a fixed gas price if gas_price_fixed is set (!= 0).
124138
gas_price_fixed = 0 # (optional for type 0 tx) sets a fixed gas price for the transaction. Defaults to 0, which will use an estimate OR a multiplier of the estimate if gas_price_multiplier is set (!= 0).
125139
# type 2 settings
126-
max_priority_fee_per_gas = "20000000000" # (optional for type 2 tx) sets priority fee per gas for a transaction in wei. Defaults to 20GWei.
127-
base_fee_per_gas_cap = 0 # (optional for type 2 tx) sets base fee per gas cap. Defaults to 3 times estimation of needed base fee to be included in the block. !!! It is strongly recommended to keep it default. Any fixed amount may prevent the transaction from being accepted !!!
140+
max_priority_fee_multiplier = 2 # (optional for type 2 tx) sets the max priority fee per gas to be a multiple of the estimated base fee. Defaults to 2.
141+
maximal_max_priority_fee_per_gas = 5000_000_000_000 # (optional for type 2 tx) maximal max priority fee per gas. Defaults to 5000 Gwei.
142+
minimal_max_priority_fee =100_000_000_000 # (optional for type 2 tx) minimal max priority fee per gas. Defaults to 100 Gwei.
143+
base_fee_multiplier = 4 # (optional for type 2 tx) sets the base fee to be a multiple of the estimated base fee. Defaults to 4.
128144

129-
[gas_relay] # applies to finalization transaction
130-
tx_type = 0
131-
gas_limit = 0
132-
gas_price_multiplier = 0
133-
gas_price_fixed = 0
134-
max_priority_fee_per_gas = "20000000000"
135-
base_fee_per_gas_cap = 0
136-
```
137145

138-
Currently only type 0 transactions are supported for registration.
139146

140-
```toml
141-
[gas_register] # applies to all voter registration transaction
142-
tx_type = 0
143-
gas_limit = 0
144-
gas_price_multiplier = 0
145-
gas_price_fixed = 0
147+
[gas_relay] # applies to finalization transaction
148+
tx_type = 2
149+
max_priority_fee_multiplier = 2
150+
maximal_max_priority_fee = 5000_000_000_000 # 5000 Gwei
151+
minimal_max_priority_fee = 100_000_000_000 # 100 Gwei
152+
base_fee_multiplier = 4
146153

147154

155+
[gas_register] # applies to all voter registration transaction
156+
tx_type = 2
157+
max_priority_fee_multiplier = 2
158+
maximal_max_priority_fee = 5000_000_000_000 # 5000 Gwei
159+
minimal_max_priority_fee = 100_000_000_000 # 100 Gwei
160+
base_fee_multiplier = 4
161+
162+
163+
[gas_systems_manager] # applies to transactions to FlareSystemsManager contract
164+
tx_type = 2
165+
max_priority_fee_multiplier = 2
166+
maximal_max_priority_fee = 5000_000_000_000 # 5000 Gwei
167+
minimal_max_priority_fee = 100_000_000_000 # 100 Gwei
168+
base_fee_multiplier = 4
169+
```
148170

171+
```toml
149172
[rewards] # reward signing configuration - clients.enabled_reward_signing must be set to true
150173
# URL prefix for retrieving reward distribution data.
174+
151175
# A full URL will be constructed by appending the epoch id and expected file name: <prefix>/<epochId>/reward-distribution-data.json
176+
152177
#
178+
153179
# For example, if reward data for an epoch can be retrieved at https://raw.githubusercontent.com/flare-foundation/fsp-rewards/refs/heads/main/songbird/240/reward-distribution-data.json,
180+
154181
# then the url_prefix should be set to "https://raw.githubusercontent.com/flare-foundation/fsp-rewards/refs/heads/main/songbird"
182+
155183
url_prefix = ""
156184
min_reward = 0 # minimum acceptable claim amount in wei for the identity address of this provider, default 0.
157185
max_reward = 0 # (optional) maximum acceptable claim amount in wei for the identity address of this provider. If 0 or not set, no maximum is enforced.
158-
retries = 8 # (optional) number of retries for fetching and signing reward data, default: 8.
186+
retries = 8 # (optional) number of retries for fetching and signing reward data, default: 8.
159187
retry_interval = "6h" # (optional) interval between retries, default: 6 hours.
188+
160189
```

SECURITY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Security
2+
3+
We recommend using the latest released version.
4+
5+
## Reporting Vulnerabilities
6+
7+
Please do not report a vulnerability using an issue or any other public channel.
8+
9+
If you have found a possible vulnerability, please send an email to `security at flare dot network`.
10+
11+
## Bug bounties
12+
13+
We sincerely appreciate and encourage reports of suspected security vulnerabilities.
14+
Please refer to our [Immunefi Bug Bounty Program](https://immunefi.com/bug-bounty/flarenetwork/information/) for scope, rules, and submission guidelines.
15+
16+
## Vulnerability disclosures
17+
18+
Critical vulnerabilities will be disclosed via GitHub's
19+
[security advisory](https://github.com/flare-foundation/flare-system-client/security)
20+
system.
21+
22+
## Audit reports
23+
24+
Audit reports are published on Flare's [Developer Hub](https://dev.flare.network/support/audits/).

0 commit comments

Comments
 (0)