Skip to content

Commit

Permalink
Merge branch 'main' into bloom_rm
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Dec 2, 2024
2 parents a34a405 + aa54d1d commit 0977f41
Show file tree
Hide file tree
Showing 202 changed files with 3,294 additions and 2,467 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/ci-cd-main-branch-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,9 @@ on:
workflow_dispatch:

jobs:
define_matrix:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.os.outputs.os }}

steps:
- name: Define os
id: os
run: echo 'os=ubuntu-latest' >> "$GITHUB_OUTPUT"

Build:
needs: define_matrix
runs-on: ${{ needs.define_matrix.outputs.os }}
runs-on: ubuntu-latest
timeout-minutes: 45
outputs:
docker_build_tag: ${{ steps.built_tag_export.outputs.docker_build_tag }}
Expand Down Expand Up @@ -167,11 +157,3 @@ jobs:
fi
echo "Done."
done
run-kurtosis-assertoor:
needs: [define_matrix, Build]
uses: erigontech/erigon/.github/workflows/test-kurtosis-assertoor.yml@main
with:
checkout_ref: ${{ github.sha }}
os: ${{ needs.define_matrix.outputs.os }}
docker_build_tag: ${{ needs.Build.outputs.docker_build_tag }}
2 changes: 1 addition & 1 deletion .github/workflows/qa-rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Checkout RPC Tests Repository & Install Requirements
run: |
rm -rf ${{ runner.workspace }}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.20.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.22.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{ runner.workspace }}/rpc-tests
pip3 install -r requirements.txt
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/scripts/run_rpc_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,10 @@ disabled_tests=(
trace_rawTransaction
# Erigon bug https://github.com/erigontech/erigon/issues/12603
erigon_getLatestLogs
# created task https://github.com/erigontech/erigon/issues/12668 is merged
debug_traceCallMany/test_02.tar
debug_traceCallMany/test_04.tar
debug_traceCallMany/test_05.tar
debug_traceCallMany/test_06.tar
debug_traceCallMany/test_07.tar
debug_traceCallMany/test_09.json
debug_traceCallMany/test_10.tar
# to investigate
engine_exchangeCapabilities/test_1.json
engine_exchangeTransitionConfigurationV1/test_01.json
engine_getClientVersionV1/test_1.json
# waiting PR https://github.com/erigontech/rpc-tests/pull/298 to be merged
trace_replayBlockTransactions/test_29.tar
# these tests requires Erigon active
admin_nodeInfo/test_01.json
admin_peers/test_01.json
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ du -hsc /erigon/snapshots/*
- **Store most of data in immutable files (segments/snapshots):**
- can symlink/mount latest state to fast drive and history to cheap drive
- `chaindata` is less than `15gb`. It's ok to `rm -rf chaindata`. (to prevent grow: recommend `--batchSize <= 1G`)
- **`--prune` flags changed**: see `--prune.mode` (default: `archive`, full: `full`, EIP-4444: `minimal`)
- **`--prune` flags changed**: see `--prune.mode` (default: `full`, archive: `archive`, EIP-4444: `minimal`)
- **Other changes:**
- ExecutionStage included many E2 stages: stage_hash_state, stage_trie, log_index, history_index, trace_index
- Restart doesn't loose much partial progress: `--sync.loop.block.limit=5_000` enabled by default
Expand Down
25 changes: 17 additions & 8 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (b *SimulatedBackend) CodeAt(ctx context.Context, contract libcommon.Addres
}
defer tx.Rollback()
stateDB := b.stateByBlockNumber(tx, blockNumber)
return stateDB.GetCode(contract), nil
return stateDB.GetCode(contract)
}

// BalanceAt returns the wei balance of a certain account in the blockchain.
Expand All @@ -220,7 +220,7 @@ func (b *SimulatedBackend) BalanceAt(ctx context.Context, contract libcommon.Add
}
defer tx.Rollback()
stateDB := b.stateByBlockNumber(tx, blockNumber)
return stateDB.GetBalance(contract), nil
return stateDB.GetBalance(contract)
}

// NonceAt returns the nonce of a certain account in the blockchain.
Expand All @@ -234,7 +234,7 @@ func (b *SimulatedBackend) NonceAt(ctx context.Context, contract libcommon.Addre
defer tx.Rollback()

stateDB := b.stateByBlockNumber(tx, blockNumber)
return stateDB.GetNonce(contract), nil
return stateDB.GetNonce(contract)
}

// StorageAt returns the value of key in the storage of an account in the blockchain.
Expand Down Expand Up @@ -518,7 +518,7 @@ func (b *SimulatedBackend) PendingCodeAt(ctx context.Context, contract libcommon
b.mu.Lock()
defer b.mu.Unlock()

return b.pendingState.GetCode(contract), nil
return b.pendingState.GetCode(contract)
}

func newRevertError(result *evmtypes.ExecutionResult) *revertError {
Expand Down Expand Up @@ -600,7 +600,7 @@ func (b *SimulatedBackend) PendingNonceAt(ctx context.Context, account libcommon
b.mu.Lock()
defer b.mu.Unlock()

return b.pendingState.GetNonce(account), nil
return b.pendingState.GetNonce(account)
}

// SuggestGasPrice implements ContractTransactor.SuggestGasPrice. Since the simulated
Expand Down Expand Up @@ -628,7 +628,10 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
}
// Recap the highest gas allowance with account's balance.
if call.GasPrice != nil && !call.GasPrice.IsZero() {
balance := b.pendingState.GetBalance(call.From) // from can't be nil
balance, err := b.pendingState.GetBalance(call.From) // from can't be nil
if err != nil {
return 0, err
}
available := balance.ToBig()
if call.Value != nil {
if call.Value.ToBig().Cmp(available) >= 0 {
Expand Down Expand Up @@ -724,7 +727,10 @@ func (b *SimulatedBackend) callContract(_ context.Context, call ethereum.CallMsg
call.Value = new(uint256.Int)
}
// Set infinite balance to the fake caller account.
from := statedb.GetOrNewStateObject(call.From)
from, err := statedb.GetOrNewStateObject(call.From)
if err != nil {
return nil, err
}
from.SetBalance(uint256.NewInt(0).SetAllOne(), tracing.BalanceChangeUnspecified)
// Execute the call.
msg := callMsg{call}
Expand Down Expand Up @@ -752,7 +758,10 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, txn types.Transa
if senderErr != nil {
return fmt.Errorf("invalid transaction: %w", senderErr)
}
nonce := b.pendingState.GetNonce(sender)
nonce, err := b.pendingState.GetNonce(sender)
if err != nil {
return err
}
if txn.GetNonce() != nonce {
return fmt.Errorf("invalid transaction nonce: got %d, want %d", txn.GetNonce(), nonce)
}
Expand Down
5 changes: 4 additions & 1 deletion accounts/abi/bind/backends/simulated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ func TestNewSimulatedBackend(t *testing.T) {
}

statedb := sim.stateByBlockNumber(tx, new(big.Int).SetUint64(num+1))
bal := statedb.GetBalance(testAddr)
bal, err := statedb.GetBalance(testAddr)
if err != nil {
t.Fatal(err)
}
if !bal.Eq(expectedBal) {
t.Errorf("expected balance for test address not received. expected: %v actual: %v", expectedBal, bal)
}
Expand Down
1 change: 1 addition & 0 deletions cl/beacon/handler/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (a *ApiHandler) PostEthV1ValidatorSyncCommitteeSubscriptions(w http.Respons
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
//cn()
}

// subscribe to subnets
Expand Down
1 change: 0 additions & 1 deletion cl/phase1/forkchoice/on_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func (f *ForkChoiceStore) OnAttestation(
return err
}
}

var attestationIndicies []uint64
var err error
target := data.Target
Expand Down
1 change: 0 additions & 1 deletion cl/phase1/forkchoice/on_attester_slashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func (f *ForkChoiceStore) onProcessAttesterSlashing(attesterSlashing *cltypes.At
if !cltypes.IsSlashableAttestationData(attestation1.Data, attestation2.Data) {
return errors.New("attestation data is not slashable")
}

attestation1PublicKeys, err := getIndexedAttestationPublicKeys(s, attestation1)
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion cl/phase1/network/services/block_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ func (b *blockService) ProcessMessage(ctx context.Context, _ *uint64, msg *cltyp
if msg.Block.Body.BlobKzgCommitments.Len() > int(b.beaconCfg.MaxBlobsPerBlock) {
return ErrInvalidCommitmentsCount
}

b.publishBlockGossipEvent(msg)
// the rest of the validation is done in the forkchoice store
if err := b.processAndStoreBlock(ctx, msg); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/services/polygon/proofgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/erigontech/erigon-lib/common/hexutility"
"github.com/erigontech/erigon-lib/crypto"
"github.com/erigontech/erigon-lib/rlp"
"github.com/erigontech/erigon-lib/trie"
"github.com/erigontech/erigon/accounts/abi/bind"
"github.com/erigontech/erigon/cl/merkle_tree"
"github.com/erigontech/erigon/cmd/devnet/devnet"
Expand All @@ -42,6 +41,7 @@ import (
bortypes "github.com/erigontech/erigon/polygon/bor/types"
"github.com/erigontech/erigon/rpc"
"github.com/erigontech/erigon/turbo/jsonrpc"
"github.com/erigontech/erigon/turbo/trie"
)

var ErrTokenIndexOutOfRange = errors.New("index is grater than the number of tokens in transaction")
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func runCmd(ctx *cli.Context) error {
} else {
genesisConfig = new(types.Genesis)
}
agg, err := state2.NewAggregator(context.Background(), datadir.New(os.TempDir()), config3.HistoryV3AggregationStep, db, log.New())
agg, err := state2.NewAggregator(context.Background(), datadir.New(os.TempDir()), config3.DefaultStepSize, db, log.New())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/staterunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func aggregateResultsFromStateTests(
MustOpen()
defer _db.Close()

agg, err := libstate.NewAggregator(context.Background(), dirs, config3.HistoryV3AggregationStep, _db, log.New())
agg, err := libstate.NewAggregator(context.Background(), dirs, config3.DefaultStepSize, _db, log.New())
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/integration/commands/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ func allSnapshots(ctx context.Context, db kv.RoDB, logger log.Logger) (*freezebl
blockReader := freezeblocks.NewBlockReader(_allSnapshotsSingleton, _allBorSnapshotsSingleton, _heimdallStoreSingleton, _bridgeStoreSingleton)

txNums := rawdbv3.TxNums.WithCustomReadTxNumFunc(freezeblocks.ReadTxNumFuncFromBlockReader(ctx, blockReader))
_aggSingleton, err = libstate.NewAggregator(ctx, dirs, config3.HistoryV3AggregationStep, db, logger)
_aggSingleton, err = libstate.NewAggregator(ctx, dirs, config3.DefaultStepSize, db, logger)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/pics/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/memdb"
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/trie"
"github.com/erigontech/erigon/accounts/abi/bind"
"github.com/erigontech/erigon/accounts/abi/bind/backends"
"github.com/erigontech/erigon/cmd/pics/contracts"
Expand All @@ -44,6 +43,7 @@ import (
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/params"
"github.com/erigontech/erigon/turbo/stages/mock"
"github.com/erigontech/erigon/turbo/trie"
)

/*func statePicture(t *trie.Trie, number int, keyCompression int, codeCompressed bool, valCompressed bool,
Expand Down
Loading

0 comments on commit 0977f41

Please sign in to comment.