Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erigon3 upstream e4eb9fc #483

Merged
merged 91 commits into from
Aug 20, 2024
Merged

Commits on Aug 7, 2024

  1. Updgopsutilversion (erigontech#11507)

    - Updated gopsutil version as it has improvements in getting processes
    and memory info.
    dvovk authored Aug 7, 2024
    Configuration menu
    Copy the full SHA
    9605979 View commit details
    Browse the repository at this point in the history
  2. Use inlinable version of murmur3 (erigontech#11510)

    `murmur3.New*` methods return interface. And need call minimum 3 methods
    on it.
    `16ns` -> `11ns`
    
    
    Also i did bench `github.com/segmentio/murmur3` vs
    `github.com/twmb/murmur3` on 60bytes hashed string
    2nd is faster but adding asm deps. So i stick to go's dep (because asm
    deps are not friendly for cross-compilation), maybe will try it later -
    after our new release pipeline is ready. Bench results:
    intel: `20ns` -> `14ns`
    amd: `31ns` -> `26ns`
    AskAlexSharov authored Aug 7, 2024
    Configuration menu
    Copy the full SHA
    f1621bc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d919ab7 View commit details
    Browse the repository at this point in the history
  4. astrid: optimise and tidy up synchronisation points (erigontech#11504)

    Before this PR we called heimdall.Synchronize as part of
    heimdall.CheckpointsFromBlock and heimdall.MilestonesFromBlock. The
    previous implementation of Synchronize was waiting on all scrappers to
    be synchronised.
    
    This is inefficient because `heimdall.CheckpointsFromBlock` needs only
    the `checkpoints` scrapper to be synchronised. For the initial sync we
    first only need to wait for the checkpoints to be downloaded and then we
    can start downloading blocks from devp2p. While we are doing that we can
    let the spans and milestones be scrapped in the background. Note this is
    based on the fact that fetching checkpoints has been optimised by doing
    bulk fetching and finishes in seconds, while fetching Spans has not yet
    been optimised and for bor-mainnet can take a long time.
    
    Changes in the PR:
    - splits Synchronize into 3 more fine grained SynchronizeCheckpoints,
    SynchronizeMilestones and SynchronizeSpans calls which are invoked by
    the Sync algorithm at the right time
    - Optimises SynchronizeSpans to check if it already has the
    corresponding span for the given block number before blocking
    - Moves synchronisation point for Spans and State Sync Events in
    `Sync.commitExecution` just before we call
    ExecutionEngine.UpdateForkChoice to make it clearer what data is
    necessary to be sync-ed before calling Execution
    - Changes EventNotifier and Synchronize funcs to return err if ctx is
    cancelled or other errors have happened
    - Input consistency between the heimdallSynchronizer and
    bridgeSynchronizer - use blockNum instead of *type.Header
    - Interface tidy ups
    taratorio authored Aug 7, 2024
    Configuration menu
    Copy the full SHA
    df04b78 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Commitment code cleanup (erigontech#11517)

    Make Cell unexported
    Remove ProcessTree/Keys/Update
    Reviewed and refreshed all unit/bench/fuzz tests related to commitment
    erigontech#11326
    awskii authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    80c929f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abaca33 View commit details
    Browse the repository at this point in the history
  3. qa-tests: update test scheduling and timeouts (erigontech#11514)

    Change test scheduling and timeouts after Ottersync introduction.
    Now we can execute tests more frequently due to the significant
    reduction in test time.
    
    Scheduled to run every night:
    - tip-tracking
    - snap-download
    - sync-from-scratch for mainnet, minimal node
    
    Scheduled to run on Sunday:
    - sync-from-scratch for testnets, archive node
    mriccobene authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    99f6731 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    50c9a92 View commit details
    Browse the repository at this point in the history
  5. diagnostics: processes (erigontech#11516)

    - Collecting CPU and Memory usage info about all processes running on
    the machine
    - Running loop 5 times with 2 seconds delay and to calculate average
    - Sort by CPU usage
    - Write result to report file
    Result:
    ![Screenshot 2024-08-07 at 18 40
    08](https://github.com/user-attachments/assets/aac1264c-1eb9-4c8e-b6a6-7e248e37855a)
    dvovk authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    de47042 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0d99274 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dd2d76d View commit details
    Browse the repository at this point in the history
  8. polygon/heimdall: add service tests (erigontech#11426)

    closes erigontech#11173
    
    Adds tests for the Heimdall Service which cover:
    - Milestone scrapping
    - Span scrapping
    - Checkpoint scrapping
    - `Producers` API - compares the results with results from the
    `bor_getSnapshotProposerSequence` RPC API
    taratorio authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    c60d185 View commit details
    Browse the repository at this point in the history
  9. diagnostics: added cpu and memory usage details (erigontech#11526)

    - Added totals for CPU and Memory usage to processes table
    - Added CPU usage by cores
    
    Example output:
    ![Screenshot 2024-08-08 at 12 46
    17](https://github.com/user-attachments/assets/ec0897d0-81c8-4436-bb65-527363157e76)
    dvovk authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    7d9c3d6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0c44534 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9443d88 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b72568a View commit details
    Browse the repository at this point in the history
  13. polygon/heimdall: silence service tests logging (erigontech#11534)

    forgot to silence the logging in the heimdall service tests in a
    previous PR
    the logging lvl can be tweaked at times of need if debugging is
    necessary
    taratorio authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    90c9339 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. diagnostics: refactored table utils (erigontech#11537)

    Refactored table utils to have an option to generate table and return it
    as string which will used for saving data to file.
    dvovk authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    1e775d6 View commit details
    Browse the repository at this point in the history
  2. Erigon: Added verification for whether snapshots are publishable or n…

    …ot and added clearIndexing command (erigontech#11539)
    
    Main checks:
    * No gap in steps/blocks
    * Check if all indexing present
    * Check if all idx,  history, domain present
    Giulio2002 authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    1f95904 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    26d3258 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    391fc4b View commit details
    Browse the repository at this point in the history
  5. polygon: add unwind prune to sync stage (erigontech#11531)

    closes erigontech#11177
    - adds unwind logic to the new polygon sync stage which uses astrid
    - seems like we've never done running for bor heimdall so removing empty
    funcs
    taratorio authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    a3433cc View commit details
    Browse the repository at this point in the history
  6. diagnostics: refactored cpu info (erigontech#11544)

    Refactored printing cpu info:
    - move CPU details to table
    - move CPU usage next to details table
    - refactor code
    dvovk authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    119ec1f View commit details
    Browse the repository at this point in the history
  7. stagedsync: add dbg.SaveHeapProfileNearOOM to headers stage (erigonte…

    …ch#11549)
    
    relates to:
    erigontech#10734
    erigontech#11387
    
    restart Erigon with `SAVE_HEAP_PROFILE = true` env variable
    wait until we reach 45% or more alloc in stage_headers when
    "noProgressCounter >= 5" or "Rejected header marked as bad"
    taratorio authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    2a98f6a View commit details
    Browse the repository at this point in the history
  8. Move visual inside cmd/pics (erigontech#11543)

    and also move `design` into `docs` in order to reduce the number of
    top-level directories
    yperbasis authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    ff2130d View commit details
    Browse the repository at this point in the history
  9. JumpDest: evm-based LRU cache (erigontech#11524)

    Before we had transaction-wide cache (map)
    Now i changing it to evm-wide.
    EVM - is thread-unsafe object - it's ok to use thread-unsafe LRU.
    But ExecV3 already using 1-ENV per worker. Means we will share between
    blocks (not on chain-tip for now)
    
    bench: 
    - on `mainnet`: it shows 12% improvement on large eth_getLogs call
    (re-exec large historical range of blocks near 6M block) - on hot state.
    
    About chain-tip: 
    - don't see much impact (even if make cache global) - because
    mainnet/bor-mainnet current bottleneck is "flush" changes to db. but
    `integration loop_exec --unwind=2` shows 5% improvement.
    - in future PR we can share 1 lru for many new blocks - currently
    creating new one every stage loop iteration.
    AskAlexSharov authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    5b30f2e View commit details
    Browse the repository at this point in the history
  10. diagnostics: added flags to report (erigontech#11548)

    - added flags which was applied to run command to report
    dvovk authored Aug 9, 2024
    Configuration menu
    Copy the full SHA
    b0a2654 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2024

  1. E3: Remove Proof-Of-Work Consensus code (erigontech#11556)

    Notable things:
    Removed all testing on Total Difficulty or Difficulty as that is a PoW
    concept
    Integration tests about difficulty removed as they only test ETH PoW
    Remove difficulty checks in a test
    I had to tweak some hashes as I have removed difficulty computation so
    some hashes were different is some tests (now hardcoded to 1)
    
    - It is running on the tip of the chain too, YAY
    Giulio2002 authored Aug 10, 2024
    Configuration menu
    Copy the full SHA
    af4dc9d View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2024

  1. engineapi: Send status SYNCING for fcu when busy (erigontech#11491)

    CL may be able to handle a non-error message better.
    Eventually I plan on improving this corner case, as FCU has an 8s
    timeout and I don't think EL waits that long before declaring busy.
    This causes some (or all) CL(s) to miss slots, as they don't know what
    to do now
    somnathb1 authored Aug 11, 2024
    Configuration menu
    Copy the full SHA
    da2f260 View commit details
    Browse the repository at this point in the history
  2. more cl state events (erigontech#11527)

    part of erigontech#11149
    All events are supported now
    domiwei authored Aug 11, 2024
    Configuration menu
    Copy the full SHA
    647a72f View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Configuration menu
    Copy the full SHA
    1f24de6 View commit details
    Browse the repository at this point in the history
  2. Caplin: Make sure frozenBlocks >= frozenBlobs (erigontech#11558)

    Co-authored-by: Kewei <kewei.train@gmail.com>
    Giulio2002 and domiwei authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    49e443c View commit details
    Browse the repository at this point in the history
  3. polygon/sync: Fix onMilestoneEvent crash (erigontech#11568)

    Crash was due to a missing early return.
    shohamc1 authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    25da9ed View commit details
    Browse the repository at this point in the history
  4. fix concurrent rw on touchedLeaves map (erigontech#11566)

    got crash on sepolia due to concurrent rw panic:
    
    ```
    fatal error: concurrent map iteration and map write
    
    goroutine 125102027 [running, locked to thread]:
    github.com/erigontech/erigon/cl/phase1/core/state/raw.(*BeaconState).CopyInto(0xc04b46c908, 0xc04b46cb48)
            github.com/erigontech/erigon/cl/phase1/core/state/raw/copy.go:83 +0xd93
    github.com/erigontech/erigon/cl/phase1/core/state.(*CachingBeaconState).CopyInto(0xc08b77cea0, 0xc08b77d2c0)
            github.com/erigontech/erigon/cl/phase1/core/state/copy.go:28 +0x74
    github.com/erigontech/erigon/cl/phase1/core/state.(*CachingBeaconState).Copy(0xc08b77cea0)
            github.com/erigontech/erigon/cl/phase1/core/state/copy.go:66 +0x37
    github.com/erigontech/erigon/cl/phase1/stages.emitNextPaylodAttributesEvent(0xc05c490c40, 0x56133a, {0x64, 0xac, 0xff, 0x77, 0xa0, 0x8e, 0xc2, 0x14, ...}, ...)
            github.com/erigontech/erigon/cl/phase1/stages/forkchoice.go:220 +0x20b
    github.com/erigontech/erigon/cl/phase1/stages.postForkchoiceOperations({0x3215620, 0xc05bc64820}, {0x324d000, 0xc08a900280}, {0x322b8c8, 0xc09a1ae4c0}, 0xc05c490c40, 0x56133a, {0x64, 0xac, ...})
            github.com/erigontech/erigon/cl/phase1/stages/forkchoice.go:332 +0x3cb
    github.com/erigontech/erigon/cl/phase1/stages.doForkchoiceRoutine({0x3215620, 0xc05bc64820}, {0x322b8c8, 0xc09a1ae4c0}, 0xc05c490c40, {0x40, 0x2b098, 0x2b099, 0x56133a, 0x56133a, ...})
            github.com/erigontech/erigon/cl/phase1/stages/forkchoice.go:357 +0x30e
    github.com/erigontech/erigon/cl/clstages.(*StageGraph[...]).StartWithStage.func1()
            github.com/erigontech/erigon/cl/clstages/clstages.go:54 +0x6e
    created by github.com/erigontech/erigon/cl/clstages.(*StageGraph[...]).StartWithStage in goroutine 3439
            github.com/erigontech/erigon/cl/clstages/clstages.go:50 +0x3a5
    ```
    domiwei authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    5a1c4a3 View commit details
    Browse the repository at this point in the history
  5. dbg: add save heap options for logger and memstats inputs (erigontech…

    …#11575)
    
    `log.Info` does not get piped to our log files, making it hard to figure
    out what is going on
    need to pass in the correct `logger`
    this PR adds optional args to `SaveHeapProfileNearOOM` to allow passing
    in loggers and memStats when needed
    taratorio authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    bf38839 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3474232 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. FIx txpool readme (erigontech#11573)

    fix the broken path
    shashiyy authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    a484e35 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    17a595f View commit details
    Browse the repository at this point in the history
  3. Add mgas log (erigontech#11571)

    Adds:
    
    "blks", outputBlockNum-p.prevOutputBlockNum+1,
    "blk/s", fmt.Sprintf("%.1f",
    float64(outputBlockNum-p.prevOutputBlockNum+1)/interval.Seconds()),
    "txs", txCount-p.prevTxCount,
    "tx/s", fmt.Sprintf("%.1f", speedTx),
    "mgas/s", fmt.Sprintf("%.1f", mgasPerSec),
    
    to exec stage progress logging
    
    ---------
    
    Co-authored-by: Mark Holt <mark@disributed.vision>
    mh0lt and Mark Holt authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    8991773 View commit details
    Browse the repository at this point in the history
  4. Torrent close and progress reporting fixes (erigontech#11532)

    Fixes:
    erigontech#5145
    erigontech#11411
    erigontech#11424
    
    ---------
    
    Co-authored-by: Mark Holt <mark@disributed.vision>
    Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
    3 people authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    e6cda71 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    043b258 View commit details
    Browse the repository at this point in the history
  6. polygon/sync: Use store at tip (erigontech#11579)

    Previously, we were passing blocks directly to the execution client -
    bypassing events processing for the bridge as well as synchronisation
    necessary before `UpdateForkChoice`.
    
    This fixes hash mismatches at chain tip.
    shohamc1 authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    9e357e2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    12a286d View commit details
    Browse the repository at this point in the history
  8. bt: use madv_normal instead madv_readahead for index opening (erigont…

    …ech#11584)
    
    To reduce disk IO
    To protect PageCache from restart
    AskAlexSharov authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    a9e2275 View commit details
    Browse the repository at this point in the history
  9. exec: use dedicated worker for mining (erigontech#11586)

    it's not thread-safe
    also made `JumpDestCache` env-configurable - for experiments
    AskAlexSharov authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    750105f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f47b02b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    959bc37 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. E3: Added ability to download index files and accessors (erigontech#1…

    …1594)
    
    I added a panic recover when trying to read incomplete `.bt`
    Giulio2002 authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    d598a58 View commit details
    Browse the repository at this point in the history
  2. prune less blocks on chain-tip (erigontech#11593)

    to make commit time and prune time more predictable
    AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    cfe8353 View commit details
    Browse the repository at this point in the history
  3. inverted index: lru (erigontech#11530)

    - on `mainnet`: it shows +10% improvement on large eth_getLogs call
    (re-exec large historical range of blocks near 6M block) - on hot state.
    AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    593abd4 View commit details
    Browse the repository at this point in the history
  4. Replace ReaderV4 by ReaderV3 (erigontech#11600)

    - renamed `state.StateReaderV3` to `state.ReaderV3`
    - removed `ReaderV4`
    AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    12d7e76 View commit details
    Browse the repository at this point in the history
  5. fix incorrect return type for eth_egtProof (erigontech#11605)

    This PR fixes the incorrect return type of `proof` field of
    `storageProof`. The return type from erigon is `null` whereas the
    correct return type should be `[]`.
    Geth also returns `[]` in this special case which makes the PR
    compatible across different clients. Parsing `null` as return type
    breaks a few client like alloy.
    temaniarpit27 authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    e9b7e7e View commit details
    Browse the repository at this point in the history
  6. Move atomic hash from Block to Header (erigontech#11513)

    Reason 1: `NewEVMBlockContext` -> `engine.Author(header)` -> `*Bor` -> 
    
    ```
    hash := header.Hash()
    if address, known := sigcache.Get(hash); known {
       return address, nil
    }
    ```	
    it's hard and not so useful to pass `block` through this abstractions.
    
    So, RPC does hash every requested header here. 
    
    Reason 2: In E3: many RPC will read 1 transaction only. So, likely we
    will have many places where no `Block` object.
    AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    f4322d9 View commit details
    Browse the repository at this point in the history
  7. Enable LessFalsePositives feature for header.idx (erigontech#11598)

    bsc: 
    ```
    before:
    du -hsc /erigon-data/snapshots/*head*.idx
    322M	total
    
    after: 
    380M	total
    ```
    AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    2582631 View commit details
    Browse the repository at this point in the history
  8. move p2p genReceipts behind experimental env flag (erigontech#11604)

    - until measure LRU hit-rate on chain-tip of bormainnet/mainnet
    - until measure chain-tip-impact
    - maybe until erigontech#11603
    
    Reason: we have complains about chain-tip slowness and this feature is
    not essential. So, need look more careful on monitoring/stats before
    enabling.
    AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    00d6fdc View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    92e426c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2f2fa91 View commit details
    Browse the repository at this point in the history
  11. Merge MiningResultPOSCh with MiningResultCh (erigontech#11612)

    Rationale: one small step to converge Polygon and Ethereum block
    production.
    
    Also, now `(s *Merge) Seal` calls `block.WithSeal`, which is important
    after PR erigontech#11513.
    yperbasis authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    487a369 View commit details
    Browse the repository at this point in the history
  12. polygon/bor: remove unused params in NewRo (erigontech#11611)

    removes unused params in NewRo and unused code
    taratorio authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    b985c16 View commit details
    Browse the repository at this point in the history
  13. Added hooks to ProcessFrozenBlocks (erigontech#11610)

    Co-authored-by: JkLondon <ilya@mikheev.fun>
    JkLondon and JkLondon authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    82ba662 View commit details
    Browse the repository at this point in the history
  14. Delete AuRa GenerateSeal (erigontech#11616)

    We don't need to produce pre-merge AuRa blocks
    yperbasis authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    a264b9f View commit details
    Browse the repository at this point in the history
  15. Cleanup torrents of indexing files (erigontech#11596)

    I also added a more readable err when panicking on incomplete file.
    hopefully, it will not scare users.
    
    ---------
    
    Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
    Giulio2002 and AskAlexSharov authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    9e323b8 View commit details
    Browse the repository at this point in the history
  16. Bump up erigon-snapshots (erigontech#11621)

    I did an oopsie and switched erigon to a test branch on erigon-snapshot
    Giulio2002 authored Aug 14, 2024
    Configuration menu
    Copy the full SHA
    2a08e0d View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Configuration menu
    Copy the full SHA
    c31eb64 View commit details
    Browse the repository at this point in the history
  2. Ottersync: make --all flag to seed .idx, .vi, etc... (erigontech#11540)

    Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
    Giulio2002 and AskAlexSharov authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    8a28557 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9889b11 View commit details
    Browse the repository at this point in the history
  4. db: pagesize default change to 4kb (erigontech#11602)

    Bor mainnet
    <img width="532" alt="Screenshot 2024-08-14 at 12 33 55"
    src="https://github.com/user-attachments/assets/317498a2-94b3-4973-b136-2546aea30351">
    AskAlexSharov authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    c9cefa4 View commit details
    Browse the repository at this point in the history
  5. polygon/bor: simplify state receiver contract code (erigontech#11618)

    Tidying up bor contracts code:
    - Rename `GenesisContractsClient` to `StateReceiver` for clarity
    - Remove unused `LastStateId` func in `StateReceiver`
    - Move `StateReceiver` into its own file `state_receiver.go`
    - Create a gomock for it in `state_receiver_mock.go` and use in test
    - Remove unused function input for `ChainSpanner`
    taratorio authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    4772138 View commit details
    Browse the repository at this point in the history
  6. adds kurtosis-assertoor to ci (erigontech#11464)

    kurtosis assertoor tests in ci
    
    decision points:
    
    - since the job takes about 45 minutes to run, I decided not to run it
    on every PR, but rather we run it every 12 hours at 2AM/PM UTC.
    - all tests are present in
    https://github.com/ethpandaops/assertoor-test/tree/master/assertoor-tests.
    This ci runs
    [these](https://github.com/erigontech/erigon/pull/11464/files#diff-b45e49409c33f39133315225d30c02d8cfacfd9a53d1157bca61284683a4c498R22)
    tests.
    - test is for ubuntu only; not for mac or windows.
    
    Many tests are failing; specially the validator related ones. Tracked
    separately - erigontech#11590
    sudeepdino008 authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    cdc5395 View commit details
    Browse the repository at this point in the history
  7. polygon/bor: add borabi pkg (erigontech#11619)

    I'd like to add `MarshallKey`, `MarshallValue` (and corresponding
    `Unmarshall`) receiver functions on `EventRecordWithTime` which hide
    away the `abi` detail so callers don't have to deal with the ABI as a
    function input everywhere in the code base - PR
    erigontech#11620
    
    However there is a circular dependency which blocks me from doing that
    because `EventRecordWithTime` is in package `polygon/heimdall` and it
    imports `polygon/bor` package for `bor.GenesisContractStateReceiverABI`,
    however `polygon/bor` imports `polygon/heimdall` for
    `EventRecordWithTime` due to the [bor event fallback
    hack](https://github.com/erigontech/erigon/blob/main/polygon/bor/bor.go#L1516-L1556)
    we have in Bor consensus engine (it is pending removal once we fix the
    underlying issue that led to it appearing which is a WIP).
    
    For now, to unblock myself I am moving the bor ABIs in a sub-package
    `polygon/bor/borabi`
    taratorio authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    23ae58a View commit details
    Browse the repository at this point in the history
  8. polygon/heimdall: introduce event.Marshall/Unmarshall funcs to hide a…

    …bi (erigontech#11620)
    
    Relates to and inspired by
    erigontech#11225
    
    Main motivation for this change is to simplify the Bridge Store
    interface by removing the need to pass an `ABI` in the function
    signatures. But it ended up tidying up other bits of the codebase too.
    
    We should do the same for the entities in `polygon/heimdall EntityStore`
    as it is much much cleaner
    taratorio authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    ef233ed View commit details
    Browse the repository at this point in the history
  9. Revert "E3: Remove Proof-Of-Work Consensus code" (erigontech#11628)

    This reverts PR erigontech#11556, which caused Hive tests (e.g. "Bad Hash on
    NewPayload") to crash.
    yperbasis authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    c746942 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    dfa0625 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    41465d5 View commit details
    Browse the repository at this point in the history
  12. Add custom chain support to Caplin (erigontech#11508)

    Things added:
    * Keep genesis file stored in datadir
    * Fixed race conditions in Sentinel
    * Fixed scheduling of hard fork for same epoch-hardforks
    * Small refactorings
    
    ---------
    
    Co-authored-by: Kewei <kewei.train@gmail.com>
    Giulio2002 and domiwei authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    f6a39a5 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4b5373e View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. Configuration menu
    Copy the full SHA
    6b8c6eb View commit details
    Browse the repository at this point in the history
  2. diagnostics: fix setup (erigontech#11633)

    Fixed issue with setup diagnostics client on erigon start
    dvovk authored Aug 16, 2024
    Configuration menu
    Copy the full SHA
    f1e8643 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a883ad9 View commit details
    Browse the repository at this point in the history
  4. more conservative blocks prune (erigontech#11614)

    - `br.FrozenBlocks()` to ensure that all file types are exist
    AskAlexSharov authored Aug 16, 2024
    Configuration menu
    Copy the full SHA
    c28c0aa View commit details
    Browse the repository at this point in the history
  5. Prune still affecting chain-tip "fsync" (erigontech#11637)

    And write mb/s is also big at prune time - nvme handles it - but on a
    bit slower disks will affect chain-tip perf.
    
    BorMainnet: 
    <img width="1054" alt="Screenshot 2024-08-16 at 08 26 22"
    src="https://github.com/user-attachments/assets/87e8d227-ac33-4800-a53a-594d872b074f">
    
    Gnosis:
    <img width="1026" alt="Screenshot 2024-08-16 at 08 36 23"
    src="https://github.com/user-attachments/assets/1290e57c-3325-4e89-95cd-83baf8fa93c7">
    AskAlexSharov authored Aug 16, 2024
    Configuration menu
    Copy the full SHA
    5827b0b View commit details
    Browse the repository at this point in the history
  6. lru which covers all .kv files - but belongs to aggTx (erigontech…

    …#11489)
    
    - on mainnet: it shows +10% improvement on large eth_getLogs call
    (re-exec large historical range of blocks near 6M block) - on hot state.
    
    on chain tip: 
    - not noticible impact, but now it living only inside current Tx
    - maybe in future PR's I can share such LRU between block somehow 
    - on loop_exe i also not noticed difference
    AskAlexSharov authored Aug 16, 2024
    Configuration menu
    Copy the full SHA
    4c0183e View commit details
    Browse the repository at this point in the history
  7. diagnostics: added func to grab heap profile (erigontech#11643)

    - Added functionality to grab the heap profile by calling the
    diagnostics endpoint
    - Added support to pass heap profile file to diagnostics UI through
    WebSocket
    dvovk authored Aug 16, 2024
    Configuration menu
    Copy the full SHA
    820abe5 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2024

  1. Configuration menu
    Copy the full SHA
    3cb847b View commit details
    Browse the repository at this point in the history
  2. qa-tests: save erigon logs for future inspections (erigontech#11654)

    Save erigon logs into test zip attachment
    mriccobene authored Aug 17, 2024
    Configuration menu
    Copy the full SHA
    6c387bf View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2024

  1. Erigon 3: Prune canonical markers - CanonicalHash, HeaderNumber f…

    …rom chaindata (erigontech#11634)
    
    We prune `CanonicalHash` and `HeaderNumber ` in `chaindata`. this leads
    to a -99% in these 2 tables and reduce their total size to 40 pages in
    TOTAL (from >500k pages).
    
    Benchmarks:
    
    ```
    Total time taken to query blocks from 1000000 to 3000000: 1720.1410 seconds (OLD)
    Total time taken to query blocks from 1000000 to 3000000: 1747.4729 seconds (New)
    
    Amortized delta cost: 0.1ms/req
    ```
    
    Is the RPC working for those ranges? Yes.
    
    ## How does it work?
    
    Query canonical hash from snapshots by: `viewHeaderByNumber` ->
    `header.Hash()` if db hit is missed
    Query header number from snapshots by: `viewHeaderByHash` ->
    `header.Num64` if db hit is missed
    Giulio2002 authored Aug 18, 2024
    Configuration menu
    Copy the full SHA
    c78450c View commit details
    Browse the repository at this point in the history
  2. e3: bind ii/domain lru to _visibleFiles object (erigontech#11652)

    10% better throughput and latency of: small eth_getLogs, big eth_getLogs
    increased limit to 4096 - because can re-use lru objects - without worry
    on "alloc speed"
    AskAlexSharov authored Aug 18, 2024
    Configuration menu
    Copy the full SHA
    12ebd14 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Configuration menu
    Copy the full SHA
    48544c9 View commit details
    Browse the repository at this point in the history
  2. Borevent snapshot validation (erigontech#9436)

    This adds integrity checking for borevents in the following places
    
    1. Stage Bor Heimdall - check that the event occurs withing the expected
    time window
    2. Dump Events to snapshots - check that the event ids are continuous in
    and between blocks (will add a time window tests)
    3. Index event snapshots - check that the event ids are continuous in
    and between blocks
    
    It also adds an external integrity checker which runs on snapshots
    checking for continuity and timeliness of events. This can be called
    using the following command:
    `erigon snapshots integrity --datadir=~/snapshots/bor-mainnet-patch-1
    --from=45500000`
    (--to specifies an end block)
    
    This also now fixes the long running issue with bor events causing
    unexpected fails in executions:
    
    the problem event validation uncovered was a follows:
    
    The **kv.BorEventNums** mapping table currently keeps the mapping first
    event id->block. The code which produces bor-event snapshots to
    determine which events to put into the snapshot.
    
    however if no additional blocks have events by the time the block is
    stored in the snapshot, the snapshot creation code does not know which
    events to include - so drops them.
    
    This causes problems in two places:
    
    * RPC queries & re-execution from snapshots can't find these dropped
    events
    * Depending on purge timing these events may erroneously get inserted
    into future blocks
      
     The code change in this PR fixes that bug.
     
    It has been tested by running:
    
    ```
    erigon --datadir=~/chains/e3/amoy --chain=amoy --bor.heimdall=https://heimdall-api-amoy.polygon.technology --db.writemap=false --txpool.disable --no-downloader --bor.milestone=false
    ```
    
    with validation in place and the confimed by running the following:
    
    ```
    erigon snapshots rm-all-state-snapshots --datadir=~/chains/e3/amoy
    rm ~/chains/e3/amoy/chaindata/
    erigon --datadir=~/chains/e3/amoy --chain=amoy --bor-heimdall=https://heimdall-api-amoy.polygon.technology --db.writemap=false --no-downloader --bor.milestone=false
    ```
    To recreate the chain from snapshots.
    
    It has also been checked with:
    
    ```
    erigon snapshots integrity --datadir=~/chains/e3/amoy --check=NoBorEventGaps --failFast=true"
    ```
    
    ---------
    
    Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
    Co-authored-by: Mark Holt <mark@disributed.vision>
    3 people authored Aug 19, 2024
    Configuration menu
    Copy the full SHA
    e4eb9fc View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'ledgerwatch/main' into erigon3_upstream…

    …_e4eb9fc
    
    # Conflicts:
    #	cmd/state/exec3/state_recon.go
    #	core/chain_makers.go
    #	core/state/rw_v3.go
    #	core/types/block.go
    #	erigon-lib/go.mod
    #	erigon-lib/go.sum
    #	erigon-lib/kv/tables.go
    #	eth/stagedsync/exec3.go
    #	eth/stagedsync/stage_snapshots.go
    #	go.mod
    #	go.sum
    #	turbo/app/snapshots_cmd.go
    #	turbo/jsonrpc/tracing.go
    #	turbo/stages/headerdownload/header_algo_test.go
    blxdyx committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    47082da View commit details
    Browse the repository at this point in the history
  4. upstream erigon3

    blxdyx committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    55e9435 View commit details
    Browse the repository at this point in the history