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

Hooks Amendment #4225

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,15 @@ target_sources (rippled PRIVATE
src/ripple/app/tx/impl/Payment.cpp
src/ripple/app/tx/impl/SetAccount.cpp
src/ripple/app/tx/impl/SetRegularKey.cpp
src/ripple/app/tx/impl/SetHook.cpp
src/ripple/app/tx/impl/SetSignerList.cpp
src/ripple/app/tx/impl/SetTrust.cpp
src/ripple/app/tx/impl/SignerEntries.cpp
src/ripple/app/tx/impl/Taker.cpp
src/ripple/app/tx/impl/Transactor.cpp
src/ripple/app/tx/impl/apply.cpp
src/ripple/app/tx/impl/applySteps.cpp
src/ripple/app/hook/impl/applyHook.cpp
src/ripple/app/tx/impl/details/NFTokenUtils.cpp
#[===============================[
main sources:
Expand Down Expand Up @@ -578,6 +580,7 @@ target_sources (rippled PRIVATE
src/ripple/rpc/handlers/AccountLines.cpp
src/ripple/rpc/handlers/AccountObjects.cpp
src/ripple/rpc/handlers/AccountOffers.cpp
src/ripple/rpc/handlers/AccountNamespace.cpp
src/ripple/rpc/handlers/AccountTx.cpp
src/ripple/rpc/handlers/AccountTxOld.cpp
src/ripple/rpc/handlers/BlackList.cpp
Expand Down
52 changes: 52 additions & 0 deletions Builds/CMake/deps/WasmEdge.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#[===================================================================[
NIH dep: wasmedge: web assembly runtime for hooks.
#]===================================================================]

if (is_root_project) # WasmEdge not needed in the case of xrpl_core inclusion build
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(OLD_DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
set(CMAKE_DEBUG_POSTFIX _d)
endif ()
add_library (wasmedge INTERFACE)
ExternalProject_Add (wasmedge_src
PREFIX ${nih_cache_path}
GIT_REPOSITORY https://github.com/WasmEdge/WasmEdge.git
GIT_TAG 0.9.0
CMAKE_ARGS
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-DCMAKE_VERBOSE_MAKEFILE=ON>
-DCMAKE_DEBUG_POSTFIX=_d
$<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
$<$<BOOL:${MSVC}>:
"-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP"
"-DCMAKE_C_FLAGS_DEBUG=-MTd"
"-DCMAKE_C_FLAGS_RELEASE=-MT"
>
LOG_BUILD ON
LOG_CONFIGURE ON
BUILD_COMMAND
${CMAKE_COMMAND}
--build .
--config $<CONFIG>
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.12>:--parallel ${ep_procs}>
TEST_COMMAND ""
INSTALL_COMMAND ""
BUILD_BYPRODUCTS
<BINARY_DIR>/lib/api/libwasmedge_c_${CMAKE_DEBUG_POSTFIX}.so
)
ExternalProject_Get_Property (wasmedge_src BINARY_DIR)
set (wasmedge_src_BINARY_DIR "${BINARY_DIR}")
add_dependencies (wasmedge wasmedge_src)
target_include_directories (ripple_libs SYSTEM INTERFACE "${wasmedge_src_BINARY_DIR}/include/api")
target_link_libraries (wasmedge
INTERFACE
Boost::thread
Boost::system)
target_link_libraries (wasmedge INTERFACE
"${wasmedge_src_BINARY_DIR}/lib/api/libwasmedge_c${CMAKE_DEBUG_POSTFIX}.so")
target_link_libraries (ripple_libs INTERFACE wasmedge)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_DEBUG_POSTFIX ${OLD_DEBUG_POSTFIX})
endif ()
endif ()
3 changes: 3 additions & 0 deletions Builds/levelization/results/loops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Loop: ripple.basics ripple.protocol
Loop: ripple.core ripple.net
ripple.net > ripple.core

Loop: ripple.ledger ripple.protocol
ripple.ledger > ripple.protocol

Loop: ripple.net ripple.rpc
ripple.rpc > ripple.net

Expand Down
1 change: 0 additions & 1 deletion Builds/levelization/results/ordering.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ ripple.ledger > ripple.basics
ripple.ledger > ripple.beast
ripple.ledger > ripple.core
ripple.ledger > ripple.json
ripple.ledger > ripple.protocol
ripple.net > ripple.basics
ripple.net > ripple.beast
ripple.net > ripple.json
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(Boost_NO_BOOST_CMAKE ON)

# make GIT_COMMIT_HASH define available to all sources
find_package(Git)
if(Git_FOUND)
Expand Down Expand Up @@ -67,12 +69,12 @@ include(deps/Protobuf)
include(deps/gRPC)
include(deps/cassandra)
include(deps/Postgres)
include(deps/WasmEdge)

###

include(RippledCore)
include(RippledInstall)
include(RippledCov)
include(RippledMultiConfig)
include(RippledDocs)
include(RippledValidatorKeys)
8 changes: 7 additions & 1 deletion src/ripple/app/consensus/RCLConsensus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <ripple/protocol/BuildInfo.h>
#include <ripple/protocol/Feature.h>
#include <ripple/protocol/digest.h>
#include <ripple/app/misc/Transaction.h>

#include <algorithm>
#include <mutex>
Expand Down Expand Up @@ -175,6 +176,11 @@ RCLConsensus::Adaptor::share(RCLCxPeerPos const& peerPos)
void
RCLConsensus::Adaptor::share(RCLCxTx const& tx)
{
//RH TODO: never broadcast emitted transactions
//fix below:
//if (tx.isFieldPresent(sfEmitDetails))
// return;

// If we didn't relay this transaction recently, relay it to all peers
if (app_.getHashRouter().shouldRelay(tx.id()))
{
Expand Down Expand Up @@ -645,7 +651,6 @@ RCLConsensus::Adaptor::doAccept(
tapNONE,
"consensus",
[&](OpenView& view, beast::Journal j) {
// Stuff the ledger with transactions from the queue.
return app_.getTxQ().accept(app_, view);
});

Expand Down Expand Up @@ -770,6 +775,7 @@ RCLConsensus::Adaptor::buildLCL(
j_);
}();


// Update fee computations based on accepted txs
using namespace std::chrono_literals;
app_.getTxQ().processClosedLedger(app_, *built, roundTime > 5s);
Expand Down
Loading
Loading