mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Fix CI: Comment out local replace directives
- Comment out all local replace directives (../node, ../consensus, etc) - Keep only tablewriter replace which is needed - CI should now be able to download all dependencies from GitHub
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/luxfi/evm/core/state"
|
||||
"github.com/luxfi/evm/precompile/contract"
|
||||
"github.com/luxfi/geth/common"
|
||||
"github.com/luxfi/geth/core/tracing"
|
||||
"github.com/luxfi/geth/core/types"
|
||||
)
|
||||
|
||||
@@ -58,7 +59,7 @@ func (p *PrecompileAdapter) GetNonce(addr common.Address) uint64 {
|
||||
// SetNonce sets account nonce
|
||||
func (p *PrecompileAdapter) SetNonce(addr common.Address, nonce uint64) {
|
||||
if p.extState.stateDB != nil {
|
||||
p.extState.stateDB.SetNonce(addr, nonce)
|
||||
p.extState.stateDB.SetNonce(addr, nonce, tracing.NonceChangeUnspecified)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +74,7 @@ func (p *PrecompileAdapter) GetBalance(addr common.Address) *uint256.Int {
|
||||
// AddBalance adds balance to an account
|
||||
func (p *PrecompileAdapter) AddBalance(addr common.Address, amount *uint256.Int) {
|
||||
if p.extState.stateDB != nil && amount != nil {
|
||||
p.extState.stateDB.AddBalance(addr, amount)
|
||||
p.extState.stateDB.AddBalance(addr, amount, tracing.BalanceChangeUnspecified)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -300,7 +300,7 @@ func (g *Genesis) toBlock(db ethdb.Database, triedb *triedb.Database) *types.Blo
|
||||
}
|
||||
airdropAmount := uint256.MustFromBig(g.AirdropAmount)
|
||||
for _, alloc := range airdrop {
|
||||
statedb.SetBalance(alloc.Address, airdropAmount)
|
||||
statedb.SetBalance(alloc.Address, airdropAmount, tracing.BalanceIncreaseGenesisBalance)
|
||||
}
|
||||
log.Debug(
|
||||
"applied airdrop allocation",
|
||||
@@ -338,9 +338,9 @@ func (g *Genesis) toBlock(db ethdb.Database, triedb *triedb.Database) *types.Blo
|
||||
// Do custom allocation after airdrop in case an address shows up in standard
|
||||
// allocation
|
||||
for addr, account := range g.Alloc {
|
||||
statedb.SetBalance(addr, uint256.MustFromBig(account.Balance))
|
||||
statedb.SetCode(addr, account.Code)
|
||||
statedb.SetNonce(addr, account.Nonce)
|
||||
statedb.SetBalance(addr, uint256.MustFromBig(account.Balance), tracing.BalanceIncreaseGenesisBalance)
|
||||
statedb.SetCode(addr, account.Code, tracing.CodeChangeGenesis)
|
||||
statedb.SetNonce(addr, account.Nonce, tracing.NonceChangeGenesis)
|
||||
for key, value := range account.Storage {
|
||||
statedb.SetState(addr, key, value)
|
||||
}
|
||||
|
||||
@@ -29,12 +29,10 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"github.com/holiman/uint256"
|
||||
"github.com/luxfi/evm/core/state/snapshot"
|
||||
"github.com/luxfi/evm/utils"
|
||||
"github.com/luxfi/geth/common"
|
||||
ethstate "github.com/luxfi/geth/core/state"
|
||||
"github.com/luxfi/geth/core/tracing"
|
||||
)
|
||||
|
||||
// StateDB structs within the ethereum protocol are used to store anything
|
||||
@@ -123,27 +121,3 @@ func (s *StateDB) Copy() *StateDB {
|
||||
txIndex: s.txIndex,
|
||||
}
|
||||
}
|
||||
|
||||
// AddBalance adds amount to the account's balance without tracing
|
||||
// This is a wrapper for backward compatibility with old EVM code
|
||||
func (s *StateDB) AddBalance(addr common.Address, amount *uint256.Int) {
|
||||
s.StateDB.AddBalance(addr, amount, tracing.BalanceChangeUnspecified)
|
||||
}
|
||||
|
||||
// SetBalance sets the account's balance without tracing
|
||||
// This is a wrapper for backward compatibility with old EVM code
|
||||
func (s *StateDB) SetBalance(addr common.Address, amount *uint256.Int) {
|
||||
s.StateDB.SetBalance(addr, amount, tracing.BalanceChangeUnspecified)
|
||||
}
|
||||
|
||||
// SetNonce sets the account's nonce without tracing
|
||||
// This is a wrapper for backward compatibility with old EVM code
|
||||
func (s *StateDB) SetNonce(addr common.Address, nonce uint64) {
|
||||
s.StateDB.SetNonce(addr, nonce, tracing.NonceChangeUnspecified)
|
||||
}
|
||||
|
||||
// SetCode sets the account's code without tracing
|
||||
// This is a wrapper for backward compatibility with old EVM code
|
||||
func (s *StateDB) SetCode(addr common.Address, code []byte) {
|
||||
s.StateDB.SetCode(addr, code, tracing.CodeChangeUnspecified)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ package state
|
||||
import (
|
||||
"github.com/holiman/uint256"
|
||||
"github.com/luxfi/geth/common"
|
||||
"github.com/luxfi/geth/core/tracing"
|
||||
)
|
||||
|
||||
// StateUpgradeAdapter adapts the new geth StateDB interface (with BalanceChangeReason)
|
||||
@@ -16,14 +17,14 @@ type StateUpgradeAdapter struct {
|
||||
|
||||
// AddBalance implements the legacy AddBalance without BalanceChangeReason
|
||||
func (a *StateUpgradeAdapter) AddBalance(addr common.Address, amount *uint256.Int) {
|
||||
// Use the StateDB wrapper method which already handles the tracing parameter
|
||||
a.StateDB.AddBalance(addr, amount)
|
||||
// Use BalanceChangeUnspecified for state upgrade balance changes
|
||||
a.StateDB.AddBalance(addr, amount, tracing.BalanceChangeUnspecified)
|
||||
}
|
||||
|
||||
// SetNonce implements the legacy SetNonce without NonceChangeReason
|
||||
func (a *StateUpgradeAdapter) SetNonce(addr common.Address, nonce uint64) {
|
||||
// Use the StateDB wrapper method which already handles the tracing parameter
|
||||
a.StateDB.SetNonce(addr, nonce)
|
||||
// Use NonceChangeUnspecified for state upgrade nonce changes
|
||||
a.StateDB.SetNonce(addr, nonce, tracing.NonceChangeUnspecified)
|
||||
}
|
||||
|
||||
// SetState implements the stateupgrade.StateDB interface
|
||||
@@ -34,8 +35,8 @@ func (a *StateUpgradeAdapter) SetState(addr common.Address, key, value common.Ha
|
||||
|
||||
// SetCode implements the stateupgrade.StateDB interface (no return value)
|
||||
func (a *StateUpgradeAdapter) SetCode(addr common.Address, code []byte) {
|
||||
// Use the StateDB wrapper method which already handles the tracing parameter
|
||||
a.StateDB.SetCode(addr, code)
|
||||
// Call the underlying SetCode which returns the previous code but we ignore it
|
||||
_ = a.StateDB.SetCode(addr, code, tracing.CodeChangeUnspecified)
|
||||
}
|
||||
|
||||
// NewStateUpgradeAdapter creates a new adapter for state upgrade compatibility
|
||||
|
||||
@@ -56,11 +56,11 @@ func ApplyPrecompileActivations(c *params.ChainConfig, parentTimestamp *uint64,
|
||||
log.Info("Activating new precompile", "name", module.ConfigKey, "config", printIntf)
|
||||
// Set the nonce of the precompile's address (as is done when a contract is created) to ensure
|
||||
// that it is marked as non-empty and will not be cleaned up when the statedb is finalized.
|
||||
statedb.SetNonce(module.Address, 1)
|
||||
statedb.SetNonce(module.Address, 1, tracing.NonceChangeUnspecified)
|
||||
// Set the code of the precompile's address to a non-zero length byte slice to ensure that the precompile
|
||||
// can be called from within Solidity contracts. Solidity adds a check before invoking a contract to ensure
|
||||
// that it does not attempt to invoke a non-existent contract.
|
||||
statedb.SetCode(module.Address, []byte{0x1})
|
||||
statedb.SetCode(module.Address, []byte{0x1}, tracing.CodeChangeUnspecified)
|
||||
extstatedb := extstate.New(statedb)
|
||||
adapter := extstate.NewPrecompileAdapter(extstatedb)
|
||||
if err := module.Configure(params.GetExtra(c), activatingConfig, adapter, blockContext); err != nil {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/luxfi/evm
|
||||
|
||||
go 1.22.8
|
||||
go 1.24.6
|
||||
|
||||
require (
|
||||
github.com/VictoriaMetrics/fastcache v1.13.0
|
||||
@@ -203,25 +203,25 @@ require (
|
||||
replace github.com/olekukonko/tablewriter => github.com/olekukonko/tablewriter v0.0.5
|
||||
|
||||
// Use local luxfi packages instead of downloaded versions
|
||||
replace github.com/luxfi/node => ../node
|
||||
// replace github.com/luxfi/node => ../node
|
||||
|
||||
replace github.com/luxfi/consensus => ../consensus
|
||||
// replace github.com/luxfi/consensus => ../consensus
|
||||
|
||||
replace github.com/luxfi/crypto => ../crypto
|
||||
// replace github.com/luxfi/crypto => ../crypto
|
||||
|
||||
replace github.com/luxfi/database => ../database
|
||||
// replace github.com/luxfi/database => ../database
|
||||
|
||||
replace github.com/luxfi/geth => ../geth
|
||||
// replace github.com/luxfi/geth => ../geth
|
||||
|
||||
replace github.com/luxfi/ids => ../ids
|
||||
// replace github.com/luxfi/ids => ../ids
|
||||
|
||||
replace github.com/luxfi/log => ../log
|
||||
// replace github.com/luxfi/log => ../log
|
||||
|
||||
replace github.com/luxfi/math => ../math
|
||||
// replace github.com/luxfi/math => ../math
|
||||
|
||||
replace github.com/luxfi/metric => ../metric
|
||||
// replace github.com/luxfi/metric => ../metric
|
||||
|
||||
replace github.com/luxfi/warp => ../warp
|
||||
// replace github.com/luxfi/warp => ../warp
|
||||
|
||||
// For local development, uncomment the block below and comment out the CI/Production block
|
||||
// replace (
|
||||
|
||||
Reference in New Issue
Block a user