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

core: merge BaseRuleSet with IRuleSet #1941

Merged
merged 5 commits into from
Mar 27, 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
2 changes: 1 addition & 1 deletion silkworm/core/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace protocol {
bool operator==(const CliqueConfig&) const = default;
};

//! \see IRuleSet
//! \see RuleSet
using PreMergeRuleSetConfig = std::variant<NoPreMergeConfig, EthashConfig, CliqueConfig, bor::Config>;

} // namespace protocol
Expand Down
2 changes: 1 addition & 1 deletion silkworm/core/execution/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace silkworm {

ExecutionProcessor::ExecutionProcessor(const Block& block, protocol::IRuleSet& rule_set, State& state,
ExecutionProcessor::ExecutionProcessor(const Block& block, protocol::RuleSet& rule_set, State& state,
const ChainConfig& config)
: state_{state}, rule_set_{rule_set}, evm_{block, state_, config} {
evm_.beneficiary = rule_set.get_beneficiary(block.header);
Expand Down
4 changes: 2 additions & 2 deletions silkworm/core/execution/processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ExecutionProcessor {
ExecutionProcessor(const ExecutionProcessor&) = delete;
ExecutionProcessor& operator=(const ExecutionProcessor&) = delete;

ExecutionProcessor(const Block& block, protocol::IRuleSet& rule_set, State& state, const ChainConfig& config);
ExecutionProcessor(const Block& block, protocol::RuleSet& rule_set, State& state, const ChainConfig& config);

/**
* Execute a transaction, but do not write to the DB yet.
Expand Down Expand Up @@ -69,7 +69,7 @@ class ExecutionProcessor {

uint64_t cumulative_gas_used_{0};
IntraBlockState state_;
protocol::IRuleSet& rule_set_;
protocol::RuleSet& rule_set_;
EVM evm_;
};

Expand Down
254 changes: 0 additions & 254 deletions silkworm/core/protocol/base_rule_set.cpp

This file was deleted.

77 changes: 0 additions & 77 deletions silkworm/core/protocol/base_rule_set.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions silkworm/core/protocol/bor_rule_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ValidationResult BorRuleSet::validate_block_header(const BlockHeader& header, co
return ValidationResult::kInvalidMixDigest;
}

ValidationResult res{BaseRuleSet::validate_block_header(header, state, with_future_timestamp_check)};
ValidationResult res{RuleSet::validate_block_header(header, state, with_future_timestamp_check)};
if (res != ValidationResult::kOk) {
return res;
}
Expand Down Expand Up @@ -175,7 +175,7 @@ void BorRuleSet::add_fee_transfer_log(IntraBlockState& state, const intx::uint25
}

const bor::Config& BorRuleSet::config() const {
return std::get<bor::Config>(chain_config_.rule_set_config);
return std::get<bor::Config>(chain_config_->rule_set_config);
}

} // namespace silkworm::protocol
Loading
Loading