Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
dafdd4b
Adjust BP Pay Curve based on TSDP
aamirpashaa May 28, 2024
06c1410
Remove REX/sTLOS payouts auto adjustment based on TLOS price
aamirpashaa May 28, 2024
6be7ee8
Apply tiered BP pay scale
aamirpashaa Mar 5, 2025
63ca6ae
Drop deprecated action in CI and update cdt container
Mar 5, 2025
cb03872
Increase supported leap version for tests
Mar 5, 2025
e908c14
Disable trace debugging function thats giving linking issues in tests…
Mar 5, 2025
89dd088
Adapt last steps of CI to match new artifact actions APIs
Mar 5, 2025
0ef0284
Simplify CI
Mar 5, 2025
624f2fe
Vote decay implementation
poplexity Apr 7, 2025
314a208
Correcting rank variable in calculations
aamirpashaa Apr 20, 2025
0688cf2
Merge pull request #52 from telosnetwork/tiered_bp_pay
poplexity Apr 24, 2025
37d90d8
Add ability to get and store EVM votes
aamirpashaa May 1, 2025
0ebcbfa
Add action for updating BP status on EVM
aamirpashaa May 1, 2025
2730a7c
Remove an additional check, when the BP vote becomes zero in EVM
aamirpashaa May 1, 2025
fd2a0fa
Relax some of the checks
aamirpashaa May 1, 2025
5661e61
Add self-stake boost support
aamirpashaa May 5, 2025
4ee8830
Merge pull request #56 from telosnetwork/self_stake_boost
poplexity May 5, 2025
c686c8c
Merge pull request #55 from telosnetwork/evm_voting
poplexity May 5, 2025
0798af0
Better decay math and syncing decay values into EVM when they are set…
poplexity May 27, 2025
58b5f97
Using proper precision for passing the decay_increase_yearly into the…
poplexity Jun 5, 2025
6a6d4d8
Refactor self_stake_boost to use uint32_t type and adjust related log…
aamirpashaa Aug 9, 2025
f0854b0
Update self_stake_boost to use uint64_t and add self_stake_boost_mult…
aamirpashaa Aug 14, 2025
cabf1d6
Enhance producer pay calculation by implementing a detailed multiplie…
aamirpashaa Sep 12, 2025
7d917ba
Update comments
aamirpashaa Sep 12, 2025
ac5e0c0
Add checks to ensure EVM voting contract is set before executing rela…
aamirpashaa Sep 12, 2025
d6ce6e1
Merge branch 'tsdp_changes' into voting_changes
aamirpashaa Sep 12, 2025
4a1c95e
Update MAX_PRODUCERS to 35 in producer_pay.cpp, system_rotation.cpp, …
aamirpashaa Sep 21, 2025
0d47d86
Refactor producer pay calculation to use double division for improved…
aamirpashaa Nov 18, 2025
cb8bc83
Update GitHub Actions to use latest versions of checkout and upload/d…
aamirpashaa Nov 18, 2025
4ae2291
Merge branch 'fix_ci' into voting_changes
aamirpashaa Nov 18, 2025
b350fff
Change builder image to cdt 4.0.1
aamirpashaa Nov 29, 2025
62be13c
Refactor producer payment calculations in system tests to use dynamic…
aamirpashaa Nov 30, 2025
0172b78
Merge branch 'fix_ci_cdt4.0.1' into voting_changes
aamirpashaa Dec 1, 2025
1a5d156
Merge branch 'reduce_standby_bps' into voting_changes
aamirpashaa Dec 1, 2025
8a843bb
Update producer payment calculations in system tests to reflect new p…
aamirpashaa Dec 1, 2025
b00953b
Refactor producer payment calculations to use double precision for sh…
aamirpashaa Dec 4, 2025
68f1d1b
Enhance multi-producer payment tests by collecting and comparing actu…
aamirpashaa Dec 4, 2025
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
78 changes: 0 additions & 78 deletions .github/workflows/ubuntu-2004.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ubuntu-2204.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build contracts
on:
push:
branches:
- main
- "release/*"
pull_request:
types: [assigned, opened, synchronize, reopened, labeled]
env:
BUILDER_IMAGE: "apm2006/leap:v3.2.5-cdt4.0.1"
jobs:
ubuntu-2404-build:
name: Ubuntu 22.04 | Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
set -e
export DOCKER="docker run --rm -v $(pwd):/root/target ${BUILDER_IMAGE}"
docker pull ${BUILDER_IMAGE}
echo ${DOCKER}
echo =====
mkdir build
${DOCKER} bash -c "cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=yes -Dleap_DIR=/opt/leap/build/lib/cmake/leap .."
echo =====
${DOCKER} bash -c "cd build && make -j $(nproc) VERBOSE=1"
echo =====
${DOCKER} bash -c 'cd build/tests && ctest -j $(nproc)'
5 changes: 4 additions & 1 deletion contracts/eosio.system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ target_include_directories(eosio.system PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inclu
${CMAKE_CURRENT_SOURCE_DIR}/../eosio.token/include
#// TELOS BEGIN
${CMAKE_CURRENT_SOURCE_DIR}/../../libs/eosio.tedp/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libs/delphioracle/include)
${CMAKE_CURRENT_SOURCE_DIR}/../../libs/delphioracle/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libs/eosio.evm/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libs/intx/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libs/rlp/include)
#// TELOS END

set_target_properties(eosio.system PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
Expand Down
105 changes: 103 additions & 2 deletions contracts/eosio.system/include/eosio.system/eosio.system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <type_traits>

// TELOS BEGIN
#include <intx/intx.hpp>
#include <cmath>
// TELOS END
#ifdef CHANNEL_RAM_AND_NAMEBID_FEES_TO_REX
Expand Down Expand Up @@ -45,6 +46,7 @@ namespace eosiosystem {
using eosio::unsigned_int;
// TELOS
using producer_location_pair = std::pair<eosio::producer_authority, uint16_t>;
using intx::uint256;

inline constexpr int64_t powerup_frac = 1'000'000'000'000'000ll; // 1.0 = 10^15

Expand Down Expand Up @@ -454,6 +456,10 @@ namespace eosiosystem {
uint32_t reserved2 = 0;
eosio::asset reserved3;

// TELOS BEGIN
eosio::binary_extension<uint64_t> self_stake_boost = 0;
// TELOS END

uint64_t primary_key()const { return owner.value; }

enum class flags1_fields : uint32_t {
Expand All @@ -462,13 +468,81 @@ namespace eosiosystem {
cpu_managed = 4
};

// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE( voter_info, (owner)(proxy)(producers)(staked)(last_stake)(last_vote_weight)(proxied_vote_weight)(is_proxy)(flags1)(reserved2)(reserved3) )
// TELOS BEGIN
template<typename DataStream>
friend DataStream& operator << ( DataStream& ds, const voter_info& v ) {
ds << v.owner
<< v.proxy
<< v.producers
<< v.staked
<< v.last_stake
<< v.last_vote_weight
<< v.proxied_vote_weight
<< v.is_proxy
<< v.flags1
<< v.reserved2
<< v.reserved3;

if( !v.self_stake_boost.has_value() ) return ds;

return ds << v.self_stake_boost;
}

template<typename DataStream>
friend DataStream& operator >> ( DataStream& ds, voter_info& v ) {
return ds >> v.owner
>> v.proxy
>> v.producers
>> v.staked
>> v.last_stake
>> v.last_vote_weight
>> v.proxied_vote_weight
>> v.is_proxy
>> v.flags1
>> v.reserved2
>> v.reserved3
>> v.self_stake_boost;
}
// TELOS END
};


typedef eosio::multi_index< "voters"_n, voter_info > voters_table;

// TELOS BEGIN
// EVM Vote info. EVM Vote info stores information about the EVM vote:
// - `bp` the bp name
// - `total_vote` the total vote of the bp
struct [[eosio::table, eosio::contract("eosio.system")]] evm_vote_info {
eosio::name bp; /// bp name
eosio::checksum256 total_vote; /// the total vote of the bp

uint64_t primary_key()const { return bp.value; }

// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE( evm_vote_info, (bp)(total_vote) )
};
// TELOS END

// TELOS BEGIN
typedef eosio::multi_index< "evmvotes"_n, evm_vote_info,
indexed_by<"byname"_n, const_mem_fun<evm_vote_info, uint64_t, &evm_vote_info::primary_key> >
> evm_votes_table;
// TELOS END

// TELOS BEGIN
struct[[ eosio::table("votingconfig"), eosio::contract("eosio.system") ]] votingconfig {
eosio::checksum160 evm_voting_contract;
uint64_t decay_start_epoch;
uint64_t decay_increase_yearly;
uint64_t self_stake_boost_multiplier;
EOSLIB_SERIALIZE(votingconfig, (evm_voting_contract)(decay_start_epoch)(decay_increase_yearly)(self_stake_boost_multiplier))
};
// TELOS END

// TELOS BEGIN
typedef eosio::singleton< "votingconfig"_n, votingconfig > votingconfig_singleton;
// TELOS END

typedef eosio::multi_index< "producers"_n, producer_info,
indexed_by<"prototalvote"_n, const_mem_fun<producer_info, double, &producer_info::by_votes> >
Expand Down Expand Up @@ -853,6 +927,9 @@ namespace eosiosystem {
payrate_singleton _payrate;
payrates _gpayrate;
payments_table _payments;
evm_votes_table _evm_votes;
votingconfig_singleton _voting_config;
votingconfig _gvoting_config;
// TELOS END

public:
Expand All @@ -878,6 +955,7 @@ namespace eosiosystem {
static constexpr eosio::name works_account{"works.decide"_n};
static constexpr eosio::name amend_account{"amend.decide"_n};
static constexpr eosio::name delphi_oracle_account{"delphioracle"_n};
static constexpr eosio::name evm_account{"eosio.evm"_n};
// TELOS END

system_contract( name s, name code, datastream<const char*> ds );
Expand Down Expand Up @@ -1621,11 +1699,31 @@ namespace eosiosystem {
[[eosio::action]]
void pay();

[[eosio::action]]
void setvotedecay( uint64_t decay_start_epoch, uint64_t decay_increase_yearly );

[[eosio::action]]
void setvotecontr( eosio::checksum160 contract );

[[eosio::action]]
void getevmvote( std::vector<eosio::name> bps );

[[eosio::action]]
void setbpevmstat( eosio::name bp );

[[eosio::action]]
void setselfstake( uint64_t self_stake_boost_multiplier );

using unregreason_action = eosio::action_wrapper<"unregreason"_n, &system_contract::unregreason>;
using votebpout_action = eosio::action_wrapper<"votebpout"_n, &system_contract::votebpout>;
using setpayrates_action = eosio::action_wrapper<"setpayrates"_n, &system_contract::setpayrates>;
using distviarex_action = eosio::action_wrapper<"distviarex"_n, &system_contract::distviarex>;
using pay_action = eosio::action_wrapper<"pay"_n, &system_contract::pay>;
using setvotedecay_action = eosio::action_wrapper<"setvotedecay"_n, &system_contract::setvotedecay>;
using setvotecontr_action = eosio::action_wrapper<"setvotecontr"_n, &system_contract::setvotecontr>;
using getevmvote_action = eosio::action_wrapper<"getevmvote"_n, &system_contract::getevmvote>;
using setbpevmstat_action = eosio::action_wrapper<"setbpevmstat"_n, &system_contract::setbpevmstat>;
using setselfstake_action = eosio::action_wrapper<"setselfstake"_n, &system_contract::setselfstake>;
// TELOS END

private:
Expand Down Expand Up @@ -1744,6 +1842,9 @@ namespace eosiosystem {
uint64_t get_telos_average_price();

double inverse_vote_weight(double staked, double amountVotedProducers);
double decay_vote_weight_multiplier(double weighted_vote);
double apply_decay_multiplier(double weighted_vote, uint32_t sec_since_epoch, uint64_t decay_start_epoch, uint64_t decay_increase_yearly);
double uint256_to_double(uint256 value);
void recalculate_votes();

//defined in system_kick.cpp
Expand Down
Loading