Skip to content

Commit b322c4c

Browse files
committed
Changes done in 'origin/develop' specific to v1.27.0 release
2 parents 0d92587 + 4a7df5f commit b322c4c

261 files changed

Lines changed: 822 additions & 2346 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

libraries/chain/database.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@
5656

5757
long next_hf_time()
5858
{
59-
// current "next hardfork" is HF26
59+
// current "next hardfork" is HF27
6060
long hfTime =
6161

6262
#ifdef IS_TEST_NET
63-
1643716800; // Tuesday, 1 February 2022 12:00:00
63+
1665532800; // Wednesday, October 12, 2022 0:00:00 GMT
6464
#else
65-
1665489600; // Tuesday, 11 October 2022 12:00:00 GMT
65+
1666612800; // Monday, 24 October 2022 12:00:00 GMT
6666
#endif /// IS_TEST_NET
6767

68-
const char* value = getenv("HIVE_HF26_TIME");
69-
if(value != nullptr)
68+
const char* value = getenv("HIVE_HF27_TIME");
69+
if (value)
7070
{
7171
hfTime = atol(value);
72-
ilog("HIVE_HF26_TIME has been specified through environment variable as ${v}, long value: ${l}", ("v", value)("l", hfTime));
72+
ilog("HIVE_HF27_TIME has been specified through environment variable as ${value}, long value: ${hfTime}", (value)(hfTime));
7373
}
7474

7575
return hfTime;
@@ -245,7 +245,7 @@ void database::load_state_initial_data(const open_args& args)
245245
FC_ASSERT(hardforks.last_hardfork <= HIVE_NUM_HARDFORKS, "Chain knows of more hardforks than configuration", ("hardforks.last_hardfork", hardforks.last_hardfork)("HIVE_NUM_HARDFORKS", HIVE_NUM_HARDFORKS));
246246
FC_ASSERT(_hardfork_versions.versions[hardforks.last_hardfork] <= HIVE_BLOCKCHAIN_VERSION, "Blockchain version is older than last applied hardfork");
247247
FC_ASSERT(HIVE_BLOCKCHAIN_HARDFORK_VERSION >= HIVE_BLOCKCHAIN_VERSION);
248-
FC_ASSERT(HIVE_BLOCKCHAIN_HARDFORK_VERSION == _hardfork_versions.versions[HIVE_NUM_HARDFORKS]);
248+
FC_ASSERT(HIVE_BLOCKCHAIN_HARDFORK_VERSION == _hardfork_versions.versions[HIVE_NUM_HARDFORKS], "Blockchain version mismatch", (HIVE_BLOCKCHAIN_HARDFORK_VERSION)(_hardfork_versions.versions[HIVE_NUM_HARDFORKS]));
249249
});
250250

251251
#ifdef USE_ALTERNATE_CHAIN_ID
@@ -1891,7 +1891,8 @@ void database::adjust_witness_votes( const account_object& a, const share_type&
18911891

18921892
void database::adjust_witness_vote( const witness_object& witness, share_type delta )
18931893
{
1894-
const witness_schedule_object& wso = get_witness_schedule_object();
1894+
const witness_schedule_object& wso = has_hardfork(HIVE_HARDFORK_1_27_FIX_TIMESHARE_WITNESS_SCHEDULING) ?
1895+
get_witness_schedule_object_for_irreversibility() : get_witness_schedule_object();
18951896
modify( witness, [&]( witness_object& w )
18961897
{
18971898
auto delta_pos = w.votes.value * (wso.current_virtual_time - w.virtual_last_update);
@@ -6422,10 +6423,13 @@ void database::init_hardforks()
64226423
FC_ASSERT( HIVE_HARDFORK_1_26 == 26, "Invalid hardfork configuration" );
64236424
_hardfork_versions.times[ HIVE_HARDFORK_1_26 ] = fc::time_point_sec( HIVE_HARDFORK_1_26_TIME );
64246425
_hardfork_versions.versions[ HIVE_HARDFORK_1_26 ] = HIVE_HARDFORK_1_26_VERSION;
6425-
#if defined(IS_TEST_NET) && defined(HIVE_ENABLE_SMT)
64266426
FC_ASSERT( HIVE_HARDFORK_1_27 == 27, "Invalid hardfork configuration" );
64276427
_hardfork_versions.times[ HIVE_HARDFORK_1_27 ] = fc::time_point_sec( HIVE_HARDFORK_1_27_TIME );
64286428
_hardfork_versions.versions[ HIVE_HARDFORK_1_27 ] = HIVE_HARDFORK_1_27_VERSION;
6429+
#if defined(IS_TEST_NET) && defined(HIVE_ENABLE_SMT)
6430+
FC_ASSERT( HIVE_HARDFORK_1_28 == 28, "Invalid hardfork configuration" );
6431+
_hardfork_versions.times[ HIVE_HARDFORK_1_28 ] = fc::time_point_sec( HIVE_HARDFORK_1_28_TIME );
6432+
_hardfork_versions.versions[ HIVE_HARDFORK_1_28 ] = HIVE_HARDFORK_1_28_VERSION;
64296433
#endif
64306434
}
64316435

libraries/chain/witness_schedule.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ using hive::chain::util::rd_system_params;
1414
using hive::chain::util::rd_user_params;
1515
using hive::chain::util::rd_validate_user_params;
1616

17-
// this is only called on application of hf4, and the future witness schedule doesn't take
18-
// effect until a much later hard fork, so we only need to operate on the current witness schedule here.
1917
void reset_virtual_schedule_time( database& db )
2018
{ try {
21-
const witness_schedule_object& wso = db.get_witness_schedule_object();
19+
const witness_schedule_object& wso = db.has_hardfork(HIVE_HARDFORK_1_27_FIX_TIMESHARE_WITNESS_SCHEDULING) ?
20+
db.get_witness_schedule_object_for_irreversibility() : db.get_witness_schedule_object();
2221
db.modify( wso, [&](witness_schedule_object& o )
2322
{
2423
o.current_virtual_time = fc::uint128(); // reset it 0

libraries/protocol/hardfork.d/0-preamble.hf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <set>
1414

1515
#if defined(IS_TEST_NET) && defined(HIVE_ENABLE_SMT)
16-
#define HIVE_NUM_HARDFORKS 27
16+
#define HIVE_NUM_HARDFORKS 28
1717
#else
18-
#define HIVE_NUM_HARDFORKS 26
18+
#define HIVE_NUM_HARDFORKS 27
1919
#endif

libraries/protocol/hardfork.d/1_26.hf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#ifndef HIVE_HARDFORK_1_26
22
#define HIVE_HARDFORK_1_26 26
33

4-
long next_hf_time();
5-
6-
#define HIVE_HARDFORK_1_26_TIME next_hf_time()
4+
# define HIVE_HARDFORK_1_26_TIME 1665489600 // Tuesday, 11 October 2022 12:00:00 GMT
75

86
#define HIVE_HARDFORK_1_26_VERSION hive::protocol::hardfork_version( 1, 26 )
97

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#ifndef HIVE_HARDFORK_1_27
22
#define HIVE_HARDFORK_1_27 27
3-
#define HIVE_SMT_HARDFORK HIVE_HARDFORK_1_27
43

5-
#define HIVE_HARDFORK_1_27_TIME 1654084800 // Wednesday, 1 June 2022 12:00:00
4+
long next_hf_time();
5+
#define HIVE_HARDFORK_1_27_TIME next_hf_time()
66

77
#define HIVE_HARDFORK_1_27_VERSION hive::protocol::hardfork_version( 1, 27 )
88

9+
// fix scheduling of timeshare witnesses to restore pre-hf26 behavior
10+
#define HIVE_HARDFORK_1_27_FIX_TIMESHARE_WITNESS_SCHEDULING (HIVE_HARDFORK_1_27)
11+
912
#endif
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef HIVE_HARDFORK_1_28
2+
#define HIVE_HARDFORK_1_28 28
3+
#define HIVE_SMT_HARDFORK HIVE_HARDFORK_1_28
4+
5+
#define HIVE_HARDFORK_1_28_TIME 1654084800 // Wednesday, 1 June 2022 12:00:00
6+
7+
#define HIVE_HARDFORK_1_28_VERSION hive::protocol::hardfork_version( 1, 28 )
8+
9+
#endif

libraries/protocol/include/hive/protocol/config.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ using namespace hive::protocol::testnet_blockchain_configuration;
3535
#ifdef IS_TEST_NET
3636

3737
#ifdef HIVE_ENABLE_SMT
38-
#define HIVE_BLOCKCHAIN_VERSION ( version(1, 27, 0) )
38+
#define HIVE_BLOCKCHAIN_VERSION ( version(1, 28, 0) )
3939
#else
40-
#define HIVE_BLOCKCHAIN_VERSION ( version(1, 26, 0) )
40+
#define HIVE_BLOCKCHAIN_VERSION ( version(1, 27, 0) )
4141
#endif
4242

4343
#define OLD_CHAIN_ID (fc::sha256::hash("testnet"))
@@ -89,7 +89,7 @@ using namespace hive::protocol::testnet_blockchain_configuration;
8989
/// LIVE HIVE NETWORK (MainNet) ///
9090
///////////////////////////////////////////////////////////////////////////////////////////////////
9191

92-
#define HIVE_BLOCKCHAIN_VERSION ( version(1, 26, 0) )
92+
#define HIVE_BLOCKCHAIN_VERSION ( version(1, 27, 0) )
9393

9494
#ifndef HIVE_INIT_PUBLIC_KEY_STR
9595
# define HIVE_INIT_PUBLIC_KEY_STR "STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX"

libraries/protocol/include/hive/protocol/hardfork_block.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
#define HIVE_HARDFORK_0_23_BLOCK 41818752
2626
#define HIVE_HARDFORK_1_24_BLOCK 47797680
2727
#define HIVE_HARDFORK_1_25_BLOCK 55235767
28-
#define HIVE_HARDFORK_1_26_BLOCK 100000000
28+
#define HIVE_HARDFORK_1_26_BLOCK 68676505
29+
#define HIVE_HARDFORK_1_27_BLOCK 100000000
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pytest
2+
3+
pytest.register_assert_rewrite("tests.api_tests.message_format_tests.cli_wallet_tests.output_formatter_tests.local_tools")

tests/api_tests/message_format_tests/cli_wallet_tests/output_formatter_tests/block_log/generate_block_log.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import test_tools as tt
44

5-
from local_tools import create_account_and_fund_it
6-
75

86
def prepare_block_log_with_transactions():
97
node = tt.InitNode()
@@ -22,7 +20,7 @@ def prepare_block_log_with_transactions():
2220

2321

2422
def prepare_transactions(wallet) -> None:
25-
create_account_and_fund_it(wallet, 'alice', tests=tt.Asset.Test(100), vests=tt.Asset.Test(100))
23+
wallet.create_account('alice', hives=tt.Asset.Test(100), vests=tt.Asset.Test(100))
2624

2725
wallet.api.post_comment('alice', 'test-permlink', '', 'someone0', 'test-title', 'this is a body', '{}')
2826

0 commit comments

Comments
 (0)