mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Compare commits
17 Commits
pratik/Add
...
ximinez/di
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
238735d18b | ||
|
|
b986395ecc | ||
|
|
e5cdeab184 | ||
|
|
2acb3fc306 | ||
|
|
f3a9a9362d | ||
|
|
91c5ad2388 | ||
|
|
ced186ae6a | ||
|
|
e1b5945077 | ||
|
|
a2b4b06918 | ||
|
|
54d528868f | ||
|
|
6dd31bdef6 | ||
|
|
d411e38615 | ||
|
|
730ac9b763 | ||
|
|
39715d6915 | ||
|
|
fbeae82d61 | ||
|
|
429c15ac0d | ||
|
|
9382fe1c82 |
33
BUILD.md
33
BUILD.md
@@ -141,26 +141,37 @@ Alternatively, you can pull the patched recipes into the repository and use them
|
|||||||
locally:
|
locally:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Extract the version number from the lockfile.
|
||||||
|
function extract_version {
|
||||||
|
version=$(cat conan.lock | sed -nE "s@.+${1}/(.+)#.+@\1@p" | head -n1)
|
||||||
|
echo ${version}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Define which recipes to export.
|
||||||
|
recipes=(ed25519 grpc secp256k1 snappy soci)
|
||||||
|
|
||||||
|
# Selectively check out the recipes from our CCI fork.
|
||||||
cd external
|
cd external
|
||||||
mkdir -p conan-center-index
|
mkdir -p conan-center-index
|
||||||
cd conan-center-index
|
cd conan-center-index
|
||||||
git init
|
git init
|
||||||
git remote add origin git@github.com:XRPLF/conan-center-index.git
|
git remote add origin git@github.com:XRPLF/conan-center-index.git
|
||||||
git sparse-checkout init
|
git sparse-checkout init
|
||||||
git sparse-checkout set recipes/ed25519
|
for recipe in ${recipes[@]}; do
|
||||||
git sparse-checkout add recipes/grpc
|
echo "Checking out ${recipe}..."
|
||||||
git sparse-checkout add recipes/secp256k1
|
git sparse-checkout add recipes/${recipe}/all
|
||||||
git sparse-checkout add recipes/snappy
|
done
|
||||||
git sparse-checkout add recipes/soci
|
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
git checkout master
|
git checkout master
|
||||||
rm -rf .git
|
|
||||||
cd ../..
|
cd ../..
|
||||||
conan export --version 2015.03 external/conan-center-index/recipes/ed25519/all
|
|
||||||
conan export --version 1.72.0 external/conan-center-index/recipes/grpc/all
|
# Export the recipes into the local cache.
|
||||||
conan export --version 0.7.0 external/conan-center-index/recipes/secp256k1/all
|
for recipe in ${recipes[@]}; do
|
||||||
conan export --version 1.1.10 external/conan-center-index/recipes/snappy/all
|
version=$(extract_version ${recipe})
|
||||||
conan export --version 4.0.3 external/conan-center-index/recipes/soci/all
|
echo "Exporting ${recipe}/${version}..."
|
||||||
|
conan export --version $(extract_version ${recipe}) \
|
||||||
|
external/conan-center-index/recipes/${recipe}/all
|
||||||
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
In the case we switch to a newer version of a dependency that still requires a
|
In the case we switch to a newer version of a dependency that still requires a
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
// Add new amendments to the top of this list.
|
// Add new amendments to the top of this list.
|
||||||
// Keep it sorted in reverse chronological order.
|
// Keep it sorted in reverse chronological order.
|
||||||
|
|
||||||
|
XRPL_FEATURE(DefragDirectories, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(LendingProtocol, Supported::no, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(LendingProtocol, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ namespace ripple {
|
|||||||
|
|
||||||
namespace directory {
|
namespace directory {
|
||||||
|
|
||||||
|
struct Gap
|
||||||
|
{
|
||||||
|
uint64_t const page;
|
||||||
|
SLE::pointer node;
|
||||||
|
uint64_t const nextPage;
|
||||||
|
SLE::pointer next;
|
||||||
|
};
|
||||||
|
|
||||||
std::uint64_t
|
std::uint64_t
|
||||||
createRoot(
|
createRoot(
|
||||||
ApplyView& view,
|
ApplyView& view,
|
||||||
@@ -112,7 +120,9 @@ insertPage(
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
if (!view.rules().enabled(fixDirectoryLimit) &&
|
if (!view.rules().enabled(fixDirectoryLimit) &&
|
||||||
page >= dirNodeMaxPages) // Old pages limit
|
page >= dirNodeMaxPages) // Old pages limit
|
||||||
|
{
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
// We are about to create a new node; we'll link it to
|
// We are about to create a new node; we'll link it to
|
||||||
// the chain first:
|
// the chain first:
|
||||||
@@ -134,15 +144,8 @@ insertPage(
|
|||||||
// it's the default.
|
// it's the default.
|
||||||
if (page != 1)
|
if (page != 1)
|
||||||
node->setFieldU64(sfIndexPrevious, page - 1);
|
node->setFieldU64(sfIndexPrevious, page - 1);
|
||||||
XRPL_ASSERT_PARTS(
|
|
||||||
!nextPage,
|
|
||||||
"ripple::directory::insertPage",
|
|
||||||
"nextPage has default value");
|
|
||||||
/* Reserved for future use when directory pages may be inserted in
|
|
||||||
* between two other pages instead of only at the end of the chain.
|
|
||||||
if (nextPage)
|
if (nextPage)
|
||||||
node->setFieldU64(sfIndexNext, nextPage);
|
node->setFieldU64(sfIndexNext, nextPage);
|
||||||
*/
|
|
||||||
describe(node);
|
describe(node);
|
||||||
view.insert(node);
|
view.insert(node);
|
||||||
|
|
||||||
@@ -158,7 +161,7 @@ ApplyView::dirAdd(
|
|||||||
uint256 const& key,
|
uint256 const& key,
|
||||||
std::function<void(std::shared_ptr<SLE> const&)> const& describe)
|
std::function<void(std::shared_ptr<SLE> const&)> const& describe)
|
||||||
{
|
{
|
||||||
auto root = peek(directory);
|
auto const root = peek(directory);
|
||||||
|
|
||||||
if (!root)
|
if (!root)
|
||||||
{
|
{
|
||||||
@@ -169,6 +172,44 @@ ApplyView::dirAdd(
|
|||||||
auto [page, node, indexes] =
|
auto [page, node, indexes] =
|
||||||
directory::findPreviousPage(*this, directory, root);
|
directory::findPreviousPage(*this, directory, root);
|
||||||
|
|
||||||
|
if (rules().enabled(featureDefragDirectories))
|
||||||
|
{
|
||||||
|
// If there are more nodes than just the root, and there's no space in
|
||||||
|
// the last one, walk backwards to find one with space, or to find one
|
||||||
|
// missing.
|
||||||
|
std::optional<directory::Gap> gapPages;
|
||||||
|
while (page && indexes.size() >= dirNodeMaxEntries)
|
||||||
|
{
|
||||||
|
// Find a page with space, or a gap in pages.
|
||||||
|
auto [prevPage, prevNode, prevIndexes] =
|
||||||
|
directory::findPreviousPage(*this, directory, node);
|
||||||
|
if (!gapPages && prevPage != page - 1)
|
||||||
|
gapPages.emplace(prevPage, prevNode, page, node);
|
||||||
|
page = prevPage;
|
||||||
|
node = prevNode;
|
||||||
|
indexes = prevIndexes;
|
||||||
|
}
|
||||||
|
// We looped through all the pages back to the root.
|
||||||
|
if (!page)
|
||||||
|
{
|
||||||
|
// If we found a gap, use it.
|
||||||
|
if (gapPages)
|
||||||
|
{
|
||||||
|
return directory::insertPage(
|
||||||
|
*this,
|
||||||
|
gapPages->page,
|
||||||
|
gapPages->node,
|
||||||
|
gapPages->nextPage,
|
||||||
|
gapPages->next,
|
||||||
|
key,
|
||||||
|
directory,
|
||||||
|
describe);
|
||||||
|
}
|
||||||
|
std::tie(page, node, indexes) =
|
||||||
|
directory::findPreviousPage(*this, directory, root);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If there's space, we use it:
|
// If there's space, we use it:
|
||||||
if (indexes.size() < dirNodeMaxEntries)
|
if (indexes.size() < dirNodeMaxEntries)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user