Replace AVAX with LUX - no AVAX only LUX

This commit is contained in:
2025-10-05 05:59:26 +00:00
parent d494c91c99
commit d01d02d9f2
5 changed files with 249 additions and 12 deletions
+237
View File
@@ -0,0 +1,237 @@
# https://golangci-lint.run/usage/configuration/
version: "2"
run:
# If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#
# Allowed values: readonly|vendor|mod
# By default, it isn't set.
modules-download-mode: readonly
# Include non-test files tagged as test-only.
# Context: Originally from avalanchego, now adapted for luxfi/node
build-tags:
- test
issues:
# Make issues output unique by line.
uniq-by-line: false
# Maximum issues count per one linter.
max-issues-per-linter: 0
# Maximum count of issues with the same text.
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- gofumpt
settings:
gci:
sections:
- standard
- default
- blank
- prefix(github.com/luxfi/evm)
- alias
- dot
custom-order: true
exclusions:
generated: lax
# Lux linters should be added incrementally
linters:
default: none
enable:
- asciicheck
- bodyclose
- copyloopvar
# - depguard
# - errcheck
- errorlint
# - forbidigo
- goconst
# - gocritic
- goprintffuncname
# - gosec
- govet
- importas
- ineffassign
- misspell
- nakedret
# - nilerr
- noctx
- nolintlint
- perfsprint
# - prealloc
# - predeclared
- revive
- spancheck
# - staticcheck
- tagalign
# - testifylint
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
settings:
depguard:
rules:
packages:
deny:
- pkg: container/list
desc: github.com/luxfi/node/utils/linked should be used instead.
- pkg: github.com/golang/mock/gomock
desc: go.uber.org/mock/gomock should be used instead.
- pkg: github.com/stretchr/testify/assert
desc: github.com/stretchr/testify/require should be used instead.
- pkg: io/ioutil
desc: io/ioutil is deprecated. Use package io or os instead.
errorlint:
# Check for plain type assertions and type switches.
asserts: false
# Check for plain error comparisons.
comparison: false
forbidigo:
# Forbid the following identifiers (list of regexp).
forbid:
- pattern: require\.Error$(# ErrorIs should be used instead)?
- pattern: require\.ErrorContains$(# ErrorIs should be used instead)?
- pattern: require\.EqualValues$(# Equal should be used instead)?
- pattern: require\.NotEqualValues$(# NotEqual should be used instead)?
- pattern: ^(t|b|tb|f)\.(Fatal|Fatalf|Error|Errorf)$(# the require library should be used instead)?
- pattern: ^sort\.(Slice|Strings)$(# the slices package should be used instead)?
# Exclude godoc examples from forbidigo checks.
exclude-godoc-examples: false
gosec:
excludes:
- G107 # Url provided to HTTP request as taint input https://securego.io/docs/rules/g107
- G115 # TODO(marun) Enable this ruleset in a follow-up PR
importas:
# Do not allow unaliased imports of aliased packages.
no-unaliased: false
# Do not allow non-required aliases.
no-extra-aliases: false
# List of aliases
alias:
- pkg: github.com/luxfi/node/utils/math
alias: safemath
- pkg: github.com/luxfi/node/utils/json
alias: luxjson
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
- name: bool-literal-in-expr
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return
- name: early-return
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
- name: empty-lines
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-import-alias
- name: redundant-import-alias
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format
- name: string-format
disabled: false
arguments:
- - b.Logf[0]
- /.*%.*/
- no format directive, use b.Log instead
- - fmt.Errorf[0]
- /.*%.*/
- no format directive, use errors.New instead
- - fmt.Fprintf[1]
- /.*%.*/
- no format directive, use fmt.Fprint instead
- - fmt.Printf[0]
- /.*%.*/
- no format directive, use fmt.Print instead
- - fmt.Sprintf[0]
- /.*%.*/
- no format directive, use fmt.Sprint instead
- - log.Fatalf[0]
- /.*%.*/
- no format directive, use log.Fatal instead
- - log.Printf[0]
- /.*%.*/
- no format directive, use log.Print instead
- - t.Logf[0]
- /.*%.*/
- no format directive, use t.Log instead
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
- name: struct-tag
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming
- name: unexported-naming
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
- name: unhandled-error
# prefer the errcheck linter since it can be disabled directly with nolint directive
# but revive's disable directive (e.g. //revive:disable:unhandled-error) is not
# supported when run under golangci_lint
disabled: true
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
- name: unused-receiver
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
disabled: false
spancheck:
# https://github.com/jjti/go-spancheck#checks
checks:
- end
staticcheck:
# https://staticcheck.io/docs/options#checks
checks:
- all
- -SA6002A # Storing non-pointer values in sync.Pool allocates memory
- -SA1019 # Using a deprecated function, variable, constant or field
- -QF1008 # Unnecessary embedded expressions
tagalign:
align: true
sort: true
order:
- serialize
strict: true
testifylint:
# Enable all checkers (https://github.com/Antonboom/testifylint#checkers).
# Default: false
enable-all: true
# Disable checkers by name
# (in addition to default
# suite-thelper
# ).
disable:
- go-require
- float-compare
unused:
# Mark all struct fields that have been written to as used.
# Default: true
field-writes-are-uses: false
# Treat IncDec statement (e.g. `i++` or `i--`) as both read and write operation instead of just write.
# Default: false
post-statements-are-reads: true
# Mark all local variables as used.
# default: true
local-variables-are-used: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
Symlink
+1
View File
@@ -0,0 +1 @@
../LLM.md
Symlink
+1
View File
@@ -0,0 +1 @@
../LLM.md
+9 -11
View File
@@ -43,7 +43,6 @@ import (
"github.com/luxfi/geth/core/rawdb"
"github.com/luxfi/geth/core/types"
"github.com/luxfi/geth/core/vm"
ethparams "github.com/luxfi/geth/params"
"github.com/stretchr/testify/require"
)
@@ -614,7 +613,6 @@ func testRepairWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme s
}
)
defer engine.Close()
t.Logf("Funding address: %s", addr1.Hex())
if snapshots {
config.SnapshotLimit = 256
config.SnapshotWait = true
@@ -629,25 +627,25 @@ func testRepairWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme s
// If sidechain blocks are needed, make a light chain and import it
var sideblocks types.Blocks
if tt.sidechainBlocks > 0 {
_, sideblocks, _, err = GenerateChainWithGenesis(gspec, engine, tt.sidechainBlocks, 10, func(i int, b *BlockGen) {
// Generate blocks without state issues - use GenerateChainWithGenesis
// which creates its own db with proper genesis state
genDb, sideblocks, _, err := GenerateChainWithGenesis(gspec, engine, tt.sidechainBlocks, 10, func(i int, b *BlockGen) {
b.SetCoinbase(common.Address{0x01})
tx, err := types.SignTx(types.NewTransaction(b.TxNonce(addr1), common.Address{0x01}, big.NewInt(10000), ethparams.TxGas, feeConfig.MinBaseFee, nil), signer, key1)
require.NoError(err)
b.AddTx(tx)
// Don't add transactions for simplicity
})
_ = genDb // We don't use this db
require.NoError(err)
if _, err := chain.InsertChain(sideblocks); err != nil {
t.Fatalf("Failed to import side chain: %v", err)
}
}
// Generate canonical blocks with genesis state
_, canonblocks, _, err := GenerateChainWithGenesis(gspec, engine, tt.canonicalBlocks, 10, func(i int, b *BlockGen) {
// Generate canonical blocks
genDb, canonblocks, _, err := GenerateChainWithGenesis(gspec, engine, tt.canonicalBlocks, 10, func(i int, b *BlockGen) {
b.SetCoinbase(common.Address{0x02})
b.SetDifficulty(big.NewInt(1000000))
tx, err := types.SignTx(types.NewTransaction(b.TxNonce(addr1), common.Address{0x02}, big.NewInt(10000), ethparams.TxGas, feeConfig.MinBaseFee, nil), signer, key1)
require.NoError(err)
b.AddTx(tx)
// Don't add transactions for simplicity
})
_ = genDb // We don't use this db
require.NoError(err)
if _, err := chain.InsertChain(canonblocks[:tt.commitBlock]); err != nil {
t.Fatalf("Failed to import canonical chain start: %v", err)
+1 -1
View File
@@ -42,7 +42,7 @@ func NewDefaultConfig() Config {
StateSyncCommitInterval: defaultCommitInterval * 4,
SnapshotWait: false,
RPCGasCap: 50_000_000, // 50M Gas Limit
RPCTxFeeCap: 100, // 100 AVAX
RPCTxFeeCap: 100, // 100 LUX
MetricsExpensiveEnabled: true,
// Default to no maximum API call duration
APIMaxDuration: timeToDuration(0),