The LogRatelimiter class implements a fixed window rate limiter. The rate limiter allows a fixed amount of bytes to be consumed within a fixed time window. [log] Introduce source location type The SourceLocation type stores the filename and line of a source code location. In a later commit we use this type as the key type in an unordered map and set to keep track of rate limters for each location. [config] Add -ratelimitlogging config option The -ratelimitlogging can be used to enable/disable the rate limiting to disk. Rate limiting is enabled by default. [log] Add two new categories for unconditional logging We create two new categories `UNCONDITIONAL_ALWAYS` and `UNCONDITIONAL_RATE_LIMITED` that are always enabled by default. LogPrintf now logs using the `UNCONDITIONAL_RATE_LIMITED` category which will start to apply rate limiting in a later commit. For some log locations it might be safe to allow more frequent logging without rate limiting. These locations should use the `UNCONDITIONAL_ALWAYS` category. [validation] Exempt UpdateTipLog from rate limiting UpdateTipLog logs everytime a new tip is activated. This occurs at an increased frequency during IBD and should therefore be exempt from rate limiting. [log] Add rate limiting to LogPrintf To mitigate disk filling attacks caused by unsafe usages of LogPrintf, we rate limit LogPrintf by using the fixed window rate limiter (BCLog::LogRatelimiter) introduced in an earlier commit. The rate limiting logic is applied per source location instead of globally. A source location is allowed to log up to 1 MiB per hour. Source locations that violate the limit will have their logs supressed for up to one hour. [test util] Mark ~DebugLogHelper as noexcept(false) We mark ~DebugLogHelper as noexcept(false) to be able to catch the exception it throws. This lets us use it in test in combination with BOOST_CHECK_THROW and BOOST_CHECK_NO_THROW to check that certain log messages are (not) logged. [test] Check for expected log rate limiting messages [test] Test for expected file size changes when rate limiting is enabled [test] Check that log rate limiting is disabled for exempt source locations [test] Check that rate limiting can be disabled |
||
|---|---|---|
| .github | ||
| .tx | ||
| build-aux/m4 | ||
| build_msvc | ||
| ci | ||
| contrib | ||
| depends | ||
| doc | ||
| share | ||
| src | ||
| test | ||
| .cirrus.yml | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .python-version | ||
| .style.yapf | ||
| autogen.sh | ||
| configure.ac | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| INSTALL.md | ||
| libbitcoinconsensus.pc.in | ||
| Makefile.am | ||
| README.md | ||
| REVIEWERS | ||
| SECURITY.md | ||
Elements Project blockchain platform
This is the integration and staging tree for the Elements blockchain platform, a collection of feature experiments and extensions to the Bitcoin protocol. This platform enables anyone to build their own businesses or networks pegged to Bitcoin as a sidechain or run as a standalone blockchain with arbitrary asset tokens.
Modes
Elements supports a few different pre-set chains for syncing. Note though some are intended for QA and debugging only:
- Liquid mode:
elementsd -chain=liquidv1(syncs with Liquid network) - Bitcoin mainnet mode:
elementsd -chain=main(not intended to be run for commerce) - Bitcoin testnet mode:
elementsd -chain=testnet3 - Bitcoin regtest mode:
elementsd -chain=regtest - Elements custom chains: Any other
-chain=argument. It has regtest-like default parameters that can be over-ridden by the user by a rich set of start-up options.
Confidential Assets
The latest feature in the Elements blockchain platform is Confidential Assets, the ability to issue multiple assets on a blockchain where asset identifiers and amounts are blinded yet auditable through the use of applied cryptography.
- Announcement of Confidential Assets
- Confidential Assets Whitepaper to be presented April 7th at Financial Cryptography 2017 in Malta
- Confidential Assets Tutorial
- Confidential Assets Demo
- Elements Code Tutorial covering blockchain configuration and how to use the main features.
Features of the Elements blockchain platform
Compared to Bitcoin itself, it adds the following features:
- Confidential Assets
- Confidential Transactions
- Federated Two-Way Peg
- Signed Blocks
- Additional opcodes
Previous elements that have been integrated into Bitcoin:
- Segregated Witness
- Relative Lock Time
Elements deferred for additional research and standardization:
Additional RPC commands and parameters:
The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.
License
Elements is released under the terms of the MIT license. See COPYING for more information or see http://opensource.org/licenses/MIT.
What is the Elements Project?
Elements is an open source, sidechain-capable blockchain platform. It also allows experiments to more rapidly bring technical innovation to the Bitcoin ecosystem.
Learn more on the Elements Project website
https://github.com/ElementsProject/elementsproject.github.io