Commit Graph

88 Commits

Author SHA1 Message Date
Etan Kissling 0639eaafd0
in lint, fix timestamp comparison when timezone does not match (#5688)
Git by defaults returns commit timestamp according to the committer's
time zone instead of the local one, breaking the simple alphanumeric
comparison for timestamps that we use in lint. Force the timezone to
UTC so that comparison is correct regardless of committer timezone.
2024-01-03 00:34:39 +00:00
tersec aa6c13cd67
use newer geth testnet binary directory names (#5575)
* use newer geth testnet binary directory names

* linting; Geth requires merged genesis
2023-11-07 16:52:30 +01:00
tersec 95b22e3a4f
Revert "Revert "ci: adding self-hosted tag for github-runner (#4886)" (#5494)"
This reverts commit 722deedd2b.
2023-10-13 13:45:07 +02:00
tersec 722deedd2b
Revert "ci: adding self-hosted tag for github-runner (#4886)" (#5494)
This reverts commit acbfef9852.
2023-10-11 20:27:45 +00:00
apentori acbfef9852
ci: adding self-hosted tag for github-runner (#4886)
Signed-off-by: Alexis Pentori <alexis@status.im>
2023-10-11 20:26:18 +00:00
Etan Kissling a261384efc
exclude `*.service` files from lint check (#5440)
These `*.service` files are installed on user installations, so
referring to a license file outside their installation doesn't make
too much sense.
2023-09-18 21:54:06 +00:00
tersec a06c0c550f
enable Windows GitHub Actions with Nim 20 (#5413) 2023-09-12 04:57:20 +00:00
tersec 59ccd25d8d
disable GitHub Actions Windows CI harder 2023-09-08 16:35:39 +00:00
tersec b424d214c2
Windows GitHub Action builds OOM; disable (#5410) 2023-09-08 16:13:25 +00:00
Etan Kissling b8db44d761
update tested Nim versions (#5142)
Add `version-2-0` testing, and make upstream version testing Linux only.

Co-authored-by: tersec <tersec@users.noreply.github.com>
2023-09-06 19:00:15 +00:00
Etan Kissling f420f09ac1
less confusing lint error msg when bumping to very recent commit (#5400)
When bumping to a more recent commit than the configured `branch`,
currently the lint error message is confusing:

```
fatal: error processing shallow info: 4
Submodule 'vendor/nim-chronos': Failed to fetch 'master':
```

This happens when the selected commit is more recent than the latest
one on the `branch`. Comparing the commit dates allows a better message.
2023-09-06 18:52:31 +00:00
Etan Kissling 4d2fd8c2b6
fix branch check when bumping to commit outside of shallow range (#5349)
CI Lint check failed when bumping to a commit outside default shallow
range. Deepen the checkout through the bumped commit date to ensure
history is available for the ancestry check.
2023-08-24 18:23:05 +00:00
Etan Kissling bee0342f35
fix branch check in CI (#5326)
Use explicit refs to avoid occasional issues with branch check reporting
incorrectly that commit is not an ancestor of upstream head.
2023-08-19 20:49:52 +00:00
Etan Kissling 1fa3941aa5
set `WITH_UBSAN` correctly when running on GA (#5299)
GitHub actions script was not setting `WITH_UBSAN` correctly. Fix it.
2023-08-16 16:56:05 +00:00
Etan Kissling c26e8132fc
fix ubsan for `test_libnimbus_lc` (#5258)
Pass `-fsanitize=undefined` flag when compiling `test_libnimbus_lc`
when building in ubsan mode.
2023-08-07 07:57:56 +02:00
Etan Kissling 722b7f6f6b
move lint checks to separate job (#5200)
Running the lint checks separately allows running tests to check code
correctness even when targeting non-master branches or having outdated
copyright headers.
2023-07-19 13:55:23 +02:00
Etan Kissling 971b4483c5
add `libnimbus_lc.a` C library (#5122)
Add a new C library for processing light client data based on the Nimbus
implementation. This can be used from other, non-Nimbus components.
2023-07-19 09:48:39 +02:00
Etan Kissling 3c3a4ff3f3
run tests against both submodule and latest Nim (#5140)
Currently CI only tests against status `version-1-6` branch.
Update to test against the selected commit through submodule lock,
as well as the latest upstream `version-1-6` instead.
2023-06-28 23:24:23 +02:00
Etan Kissling 845bd3d570
ensure that submodule bumps are reachable (#5070)
It occurs sometimes that a submodule is bumped to a PR commit instead of
the corresponding canonical branch (as registered in `.gitmodules`).
Because we typically use `squash`, that PR commit can subsequently
become unreachable, randomly breaking the build of `nimbus-eth2`.
Prevent these accidents by only allowing submodule bumps to commits
on the branch registered in `.gitmodules`. On private branches, simply
update `.gitmodules` to match the personal dev branch.
2023-06-14 01:34:49 +00:00
tersec 3810c1b7d6
Revert "switch back to 20.04 build image (#4976)" (#5006)
This reverts commit f3719621ca.
2023-05-30 22:00:46 +00:00
tersec f3719621ca
switch back to 20.04 build image (#4976) 2023-05-30 21:27:22 +00:00
tersec 8b7ec932cb
ideally temporarily switch GitHub Actions Linux CI build image 2023-05-18 21:16:25 +00:00
Etan Kissling 3a1c468991
use merge-base for copyright year check (#4907)
Instead of comparing against current base branch head, use the common
ancestor of the PR and the base branch to avoid false positives when
a year was bumped in the base branch but not yet merged into the PR.
2023-05-09 04:07:47 +02:00
Etan Kissling 28968c11ba
remove `SAFE_SLOTS_TO_UPDATE_JUSTIFIED` (#4897)
The `SAFE_SLOTS_TO_UPDATE_JUSTIFIED` constant is no longer used as the
bouncing attack fix was removed:
https://github.com/ethereum/consensus-specs/pull/3290

Note: Some test networks still define the constant, ignoring the config
constant for now until it is no longer used.
2023-05-05 18:11:38 +00:00
Etan Kissling 4a1b94bc2e
update Deneb ANSI art for readability 🐟 (#4885)
Make "L" characters wider to improve readability.

Thanks to http://beatscribe.com (beatscribe#1008 on Discord)
2023-05-03 22:25:01 +02:00
Etan Kissling ee1bda63fa
fix copyright year check if only submodules bumped (#4879)
When only submodules were bumped but no other changes are committed,
`git diff` returns empty list, and `grep` returns 1. Suppress `grep`
error to prevent CI fail in that case.
2023-04-29 18:39:39 +00:00
Etan Kissling 8ef6223026
ignore submodules in copyright check (#4874)
Otherwise, they get reported as missing copyright header whenever
selecting a new commit for a submodule.
2023-04-28 16:57:51 +02:00
Etan Kissling 40eb7477ae
only run copyright year check in pull requests (#4871)
On `unstable`, the `git diff` doesn't work, so only check during PR.
2023-04-27 16:46:09 +00:00
Etan Kissling 351f043a61
check current copyright year in modified files (#4868)
On PR, ensure current year is listed in copyright of modified files.
Runs on Linux GitHub.
2023-04-27 17:55:11 +02:00
tersec 6a0a5c03ed
only run expensive UBSAN with probability 6.25% (#4781) 2023-04-03 16:27:07 +00:00
tersec 7892aaf08b
use UBSAN for `make test` in CI (#4763)
* use UBSAN for make test in CI

* none of the non-x86 Linux combinations works
2023-03-23 16:45:13 +02:00
tersec adeaa9e6c4
build make all targets in debug mode on GitHub Actions CI (#4655) 2023-02-27 11:30:13 +00:00
tersec c71bddb612
try not requiring brew install gnu-getopt (#4569) 2023-01-31 15:22:57 +02:00
tersec 6818120849
drop Nim 1.2 testing from GitHub Actions CI (#4525) 2023-01-19 17:55:39 +00:00
tersec 9b0868033e
use GitHub Actions cache and upload-artifact v3 (#4516) 2023-01-17 15:45:04 +00:00
tersec 7ad0d3e6c2
attempt to reduce GitHub Actions runner disk usage (#4511) 2023-01-15 08:43:50 +00:00
tersec 6ccf13e762
log Windows GitHub Action runner partition sizes (#4510) 2023-01-14 21:48:01 +00:00
tersec d2e9cdf1a0
show number of cores and total physical memory on Windows GitHub Actions (#4504) 2023-01-13 21:42:08 +00:00
tersec e09904adab
Revert "reduce intermittent Windows GitHub Actions CI build failures (#4495)" (#4502)
This reverts commit 3b60b225b3.
2023-01-13 13:22:35 +00:00
tersec 3b60b225b3
reduce intermittent Windows GitHub Actions CI build failures (#4495) 2023-01-12 14:47:33 +00:00
Jacek Sieka f3305189f1
bump & ci fixes (#4409) 2022-12-09 17:06:29 +01:00
Miran 5a4c2d0a2b
move i386 testing to nightlies + remove testing of Nim 1.4 (#4103)
* remove i386 target from ci.yml

* add i386 build to nightlies.yml

* don't continue on error for Nim 1.6

* do not test Nim 1.4
2022-09-17 08:38:18 +03:00
Jacek Sieka ff823f4aae
avoid building main binaries twice (#4092)
we can just build everything with trace logging
2022-09-08 11:13:54 +02:00
tersec b32ab88191
switch GitHub Actions CI images from Ubuntu 18.04 to 20.04 (#3988) 2022-08-18 21:07:57 +03:00
tersec 615f366dcc
update to supported macOS GitHub CI image (#3898) 2022-07-22 07:08:21 +00:00
tersec 09663e00d8
don't hide Nim 1.6 build failures (#3685) 2022-06-01 00:57:42 +00:00
Jacek Sieka 29b69129dc
enable hard failures for nim 1.6 in CI (#3642)
makes errors more visible, now that it's sort of working again
2022-05-19 05:07:33 +03:00
tersec 287a9c5f51
bump nim-stew to remove pragma disabling checks (#3555)
* bump nim-stew to remove pragma disabling checks

* use V=1 to try to capture the build VM overflow stack trace
2022-04-12 12:07:06 +02:00
Jacek Sieka 4207b127f9
era: load blocks and states (#3394)
* era: load blocks and states

Era files contain finalized history and can be thought of as an
alternative source for block and state data that allows clients to avoid
syncing this information from the P2P network - the P2P network is then
used to "top up" the client with the most recent data. They can be
freely shared in the community via whatever means (http, torrent, etc)
and serve as a permanent cold store of consensus data (and, after the
merge, execution data) for history buffs and bean counters alike.

This PR gently introduces support for loading blocks and states in two
cases: block requests from rest/p2p and frontfilling when doing
checkpoint sync.

The era files are used as a secondary source if the information is not
found in the database - compared to the database, there are a few key
differences:

* the database stores the block indexed by block root while the era file
indexes by slot - the former is used only in rest, while the latter is
used both by p2p and rest.
* when loading blocks from era files, the root is no longer trivially
available - if it is needed, it must either be computed (slow) or cached
(messy) - the good news is that for p2p requests, it is not needed
* in era files, "framed" snappy encoding is used while in the database
we store unframed snappy - for p2p2 requests, the latter requires
recompression while the former could avoid it
* front-filling is the process of using era files to replace backfilling
- in theory this front-filling could happen from any block and
front-fills with gaps could also be entertained, but our backfilling
algorithm cannot take advantage of this because there's no (simple) way
to tell it to "skip" a range.
* front-filling, as implemented, is a bit slow (10s to load mainnet): we
load the full BeaconState for every era to grab the roots of the blocks
- it would be better to partially load the state - as such, it would
also be good to be able to partially decompress snappy blobs
* lookups from REST via root are served by first looking up a block
summary in the database, then using the slot to load the block data from
the era file - however, there needs to be an option to create the
summary table from era files to fully support historical queries

To test this, `ncli_db` has an era file exporter: the files it creates
should be placed in an `era` folder next to `db` in the data directory.
What's interesting in particular about this setup is that `db` remains
as the source of truth for security purposes - it stores the latest
synced head root which in turn determines where a node "starts" its
consensus participation - the era directory however can be freely shared
between nodes / people without any (significant) security implications,
assuming the era files are consistent / not broken.

There's lots of future improvements to be had:

* we can drop the in-memory `BlockRef` index almost entirely - at this
point, resident memory usage of Nimbus should drop to a cool 500-600 mb
* we could serve era files via REST trivially: this would drop backfill
times to whatever time it takes to download the files - unlike the
current implementation that downloads block by block, downloading an era
at a time almost entirely cuts out request overhead
* we can "reasonably" recreate detailed state history from almost any
point in time, turning an O(slot) process into O(1) effectively - we'll
still need caches and indices to do this with sufficient efficiency for
the rest api, but at least it cuts the whole process down to minutes
instead of hours, for arbitrary points in time

* CI: ignore failures with Nim-1.6 (temporary)

* test fixes

Co-authored-by: Ștefan Talpalaru <stefantalpalaru@yahoo.com>
2022-03-23 09:58:17 +01:00
Ștefan Talpalaru a130ce1eac
Windows: give up stack traces for 40% better performance (#3466)
See: https://github.com/status-im/nimbus-eth2/issues/3453

TODO: make libbacktrace/libunwind work in MSYS2, to get those stack traces back.
2022-03-05 16:40:08 +02:00