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

New beta #1904

Merged
merged 194 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
b90c600
Update VERSION
DmytroNazarenko Jan 23, 2024
e048b97
Merge pull request #1798 from skalenetwork/DmytroNazarenko-patch-1
DmytroNazarenko Jan 23, 2024
254c979
SKALED-1583 Experiments with Patch Architecture
dimalit Feb 1, 2024
b58b6b1
SKALED-1583 Get rid of SealEngine
dimalit Feb 2, 2024
d5ac1eb
SKALED-1583 Introduce previous block timestamp parameter in various p…
dimalit Feb 5, 2024
31b663e
SKALED-1583 Draft usage of block timestamp for fork estimation
dimalit Feb 6, 2024
6c1a619
SKALED-1583 Added _lastBlockTimetamp everywhere, builds
dimalit Feb 7, 2024
eb693f7
SKALED-1583 Use Block's m_previousBlock
dimalit Feb 7, 2024
590809c
SKALED-1583 Add latestBlockTimestamp to EnvInfo -> Executive, Block, …
dimalit Feb 7, 2024
4e52e04
SKALED-1583 Remove latestBlockTimestamp from AlethExtVM too
dimalit Feb 7, 2024
8fe5cc9
SKALED-1583 Add and try DEFINE_AMNESIC_PATCH
dimalit Feb 8, 2024
eb0361c
SKALED-1583 Try SkipInvalidTransactionsPatch
dimalit Feb 9, 2024
fd6b393
Merge branch 'v3.19.0' into develop-to-3.19
olehnikolaiev Feb 14, 2024
381b3c7
Merge pull request #1819 from skalenetwork/develop-to-3.19
DmytroNazarenko Feb 14, 2024
babeb7a
SKALED-1583 Tests compile
dimalit Feb 14, 2024
40624e4
SKALED-1583 Adapting tests
dimalit Feb 16, 2024
b5df8f5
SKALED-1583 Do all transaction checks in SealEngine, not in Ethash
dimalit Feb 16, 2024
d1e2192
Merge branch 'develop' into enhancement/SKALED-1583-patch-architecture
dimalit Feb 20, 2024
60328c5
SKALED-1583 Fix library dependencies in testeth
dimalit Feb 21, 2024
52b0449
SKALED-1583 Fix SkaleHost tests
dimalit Feb 21, 2024
451fc2e
SKALED-1583 Fix tests
dimalit Feb 21, 2024
2166eff
SKALED-1583 Remove unneeded parameter
dimalit Feb 22, 2024
0f48b2b
SKALED-1583 Remove unused class member
dimalit Feb 22, 2024
ad8350b
SKALED-1583 Universal config of schain patches
dimalit Feb 24, 2024
ff0e82a
SKALED-1583 Fix build
dimalit Feb 26, 2024
413850c
SKALED-1583 Rename latestBlockTimestamp to committedBlockTimestamp
dimalit Feb 26, 2024
c0339d2
SKALED-1583 Use proper patch timestamp names
dimalit Feb 26, 2024
7198767
Merge branch 'v3.19.0' into develop-to-3.19.0
DmytroNazarenko Feb 26, 2024
00a09f6
SKALED-1583 Convert some patches to new arch
dimalit Feb 28, 2024
d05e981
Merge pull request #1835 from skalenetwork/develop-to-3.19.0
DmytroNazarenko Feb 28, 2024
c8e02cf
SKALED-1583 Remove frontier test
dimalit Feb 29, 2024
5361b9a
SKALED-1583 Add Push0 test
dimalit Feb 29, 2024
0c30eac
SKALED-1583 Test for StorageDestructionPatch and combine most patches…
dimalit Mar 1, 2024
e8f7cdd
SKALED-1583 Remove some patch files
dimalit Mar 4, 2024
26ba1d1
Merge branch 'v3.19.0' into enhancement/SKALED-1583-patch-architecture
dimalit Mar 4, 2024
668be42
SKALED-1583 One more patch
dimalit Mar 4, 2024
3260e70
SKALED-1583 Fix tests, but not all
dimalit Mar 4, 2024
82ccc7d
SKALED-1583 Add log and modularize code a little
dimalit Mar 5, 2024
5adcf01
SKALED-1583 Add back patches descriptions
dimalit Mar 5, 2024
5915655
SKALED-1583 Small beautifying and introduction of enum
dimalit Mar 7, 2024
c664283
SKALED-1583 Fix some tests
dimalit Mar 11, 2024
537141d
SKALED-1583 Some prettifying
dimalit Mar 11, 2024
9d92873
SKALED-1583 Remove endl in some palces
dimalit Mar 11, 2024
9bd2542
SKALED-1583 Make some parameters' names more clear
dimalit Mar 12, 2024
3936651
SKALED-1583 Fix buid
dimalit Mar 13, 2024
3d5cefc
#1774 change hwm limits for zmq broadcast
olehnikolaiev Mar 13, 2024
bf14d01
#1774 fix typo
olehnikolaiev Mar 13, 2024
5452ee7
Merge pull request #1849 from skalenetwork/bug/1774-change-zmq-broadc…
olehnikolaiev Mar 14, 2024
888c64d
SKALED-1583 Use correct block in eth_call() and eth_estimateGas(). Al…
dimalit Mar 18, 2024
263d4b7
#1825 Update eth_call unit test
DmytroNazarenko Mar 18, 2024
450c3e6
#1825 Update eth_call unit test
DmytroNazarenko Mar 18, 2024
b1ccbf1
#1825 Add support of input field in tx dict
DmytroNazarenko Mar 18, 2024
18c5f04
#1825 Fix linter
DmytroNazarenko Mar 18, 2024
3d6422c
#1825 Fix linter
DmytroNazarenko Mar 19, 2024
b9d676c
SKALED-1853 Add test for historic and fix estimateGas
dimalit Mar 19, 2024
0a9837d
SKALED-1583 Fix test
dimalit Mar 19, 2024
45d8a50
SKALED-1583 Fix rand in tests
dimalit Mar 19, 2024
5a6f7d0
#1719 add support for type1 and type2 txns
olehnikolaiev Mar 19, 2024
1288218
#1719 fix txn handling in verifyBlock
olehnikolaiev Mar 20, 2024
7410de4
SKALED-1583 Minor polishing
dimalit Mar 20, 2024
4c8794d
#1825 Remove dead code
DmytroNazarenko Mar 20, 2024
73803db
Merge pull request #1852 from skalenetwork/enhancement/update-eth-cal…
DmytroNazarenko Mar 20, 2024
aadb0e2
#1719 add more tests
olehnikolaiev Mar 21, 2024
3d9968f
SKALED-1583 Minor changes
dimalit Mar 21, 2024
2fe5699
#1719 add new required fields to json api responses
olehnikolaiev Mar 22, 2024
aa00f50
#1719 add new required fields to json api responses
olehnikolaiev Mar 22, 2024
41b7112
#1719 handle accessList in transactions
olehnikolaiev Mar 25, 2024
4d6da08
#1719 add eth_createAccessList method
olehnikolaiev Mar 25, 2024
b43a624
#1719 add unittests for type2 txns
olehnikolaiev Mar 27, 2024
48c7180
#1719 add new json rpc api methods
olehnikolaiev Mar 27, 2024
09ecc84
#1719 add unittests for txn serialization
olehnikolaiev Mar 27, 2024
6a84e6f
#1719 cleanup
olehnikolaiev Apr 1, 2024
93c2146
#1719 add baseFeePerGas in eth_getBlock calls
olehnikolaiev Apr 1, 2024
92bd60f
#1719 add extra checks
olehnikolaiev Apr 1, 2024
8243d5c
#1719 add extra checks in test
olehnikolaiev Apr 2, 2024
1d2b710
#1719 cleanup
olehnikolaiev Apr 2, 2024
eb5030c
Merge branch 'v3.19.0' into enhancement/SKALED-1583-patch-architecture
dimalit Apr 3, 2024
08f66ef
IS-833 Add patch for maxStorageForSelfdestruct
dimalit Apr 4, 2024
74f58a4
1583 Fix solidity version in test
kladkogex Apr 4, 2024
a1daeb2
1583 Fix crash because of unknown name
kladkogex Apr 4, 2024
c148a94
1583 Fix crash because of unknown name
kladkogex Apr 4, 2024
051f188
1583 add test
kladkogex Apr 4, 2024
7626eb1
1583 add test
kladkogex Apr 4, 2024
7e36fca
SKALED-1583 Merge v3.17.2
dimalit Apr 5, 2024
0589081
#1719 fix sha3 hash calculation for invalid transactions
olehnikolaiev Apr 8, 2024
dc7a567
#1719 fix getTransactionReceipt for HISTORIC STATE
olehnikolaiev Apr 8, 2024
5155bfc
Merge branch 'v3.17.2' into enhancement/SKALED-1583-patch-architectur…
dimalit Apr 8, 2024
9b5992b
SKALED-1583 Formatting
dimalit Apr 8, 2024
75dce1f
SKALED-1583 Format
dimalit Apr 8, 2024
583cc06
Merge branch 'develop' into enhancement/SKALED-1583-patch-architectur…
dimalit Apr 9, 2024
4bfa0e2
SKALED-1583 Enable full debug API by flag
dimalit Apr 9, 2024
eea7152
Merge branch 'develop' into enhancement/SKALED-1583-patch-architectur…
dimalit Apr 10, 2024
9b6538e
Merge branch 'v3.19.0' into develop-to-3.19.0
DmytroNazarenko Apr 10, 2024
d237b0f
Merge pull request #1866 from skalenetwork/develop-to-3.19.0
dimalit Apr 10, 2024
f813411
Merge remote-tracking branch 'origin/v3.19.0' into enhancement/SKALED…
dimalit Apr 10, 2024
49aa213
#1719 add tests for new json-rpc methods
olehnikolaiev Apr 10, 2024
4eb22fc
Rename patches in SchainPatch
DmytroNazarenko Apr 12, 2024
5233f5f
#1719 add more tests
olehnikolaiev Apr 15, 2024
fcd1736
#1719 fix accessList in transaction object
olehnikolaiev Apr 15, 2024
45bac48
#1719 fix accessList in transaction object
olehnikolaiev Apr 15, 2024
057d494
SKALED-1719 Some code rearrangement
dimalit Apr 15, 2024
62b56b3
SKALED-1583 Some polishing
dimalit Apr 16, 2024
f86098f
SKALED-1719 Hide streamRlp()
dimalit Apr 16, 2024
e19191c
SKALED-1719 Fix if
dimalit Apr 16, 2024
66db975
Merge remote-tracking branch 'origin/feature/1719-eip1559' into exper…
dimalit Apr 16, 2024
58aa464
#1719 add gasPrice check for type2 transactions
olehnikolaiev Apr 17, 2024
913844f
Merge pull request #1868 from skalenetwork/enhancement/SKALED-1583-pa…
dimalit Apr 17, 2024
bc9cd39
SKALED-1719 More prettifying
dimalit Apr 17, 2024
1f30267
#1719 fix yParity field in json-rpc responses
olehnikolaiev Apr 17, 2024
1815ebf
SKALED-1719 Use separate function to extract transaction bytes
dimalit Apr 17, 2024
a35280a
#1719 handle price absence in the db
olehnikolaiev Apr 18, 2024
a2dd1de
#1719 small fixes
olehnikolaiev Apr 19, 2024
5b8b374
Merge branch 'v3.19.0' into feature/1719-eip1559
olehnikolaiev Apr 22, 2024
a022d70
#1719 fix build after merge
olehnikolaiev Apr 22, 2024
7622b15
Merge pull request #1872 from skalenetwork/experiment/1719-proposed-c…
olehnikolaiev Apr 22, 2024
fea8f46
Merge branch 'feature/1719-eip1559' of github.com:skalenetwork/skaled…
olehnikolaiev Apr 22, 2024
e14427d
#1719 add patch timestamp to json rpc api
olehnikolaiev Apr 22, 2024
41c3a87
#1719 add eip1559PatchTimestamp
olehnikolaiev Apr 22, 2024
798f2b1
#1719 fix tests
olehnikolaiev Apr 22, 2024
dfb3f3e
#1719 add patchTimestamp to tests
olehnikolaiev Apr 22, 2024
7fb0ac2
#1719 small fixes
olehnikolaiev Apr 22, 2024
31f49af
#1719 fix tests
olehnikolaiev Apr 23, 2024
a5ad610
#1719 small fixes
olehnikolaiev Apr 23, 2024
aeeac8b
#1719 fix patchTimestamp usage
olehnikolaiev Apr 23, 2024
d8bd5da
#1719 fix patchTimestamp usage
olehnikolaiev Apr 23, 2024
fed61bb
#1876 Add isAddressWhitelistedCallData overload
DmytroNazarenko Apr 24, 2024
cafa20d
#1719 small fixes
olehnikolaiev Apr 24, 2024
ac59ebb
#1719 add effectiveGasPrice to receipt
olehnikolaiev Apr 24, 2024
34780be
#1719 eth_call improvement
olehnikolaiev Apr 24, 2024
0d99d32
#1719 strict chainId check in streamRLP
olehnikolaiev Apr 24, 2024
0fa32a3
#1719 feeHistory improvements
olehnikolaiev Apr 24, 2024
4c2d7af
#1719 fix tests
olehnikolaiev Apr 24, 2024
1bfeba4
IS-864 bls sync config
olehnikolaiev Apr 24, 2024
7e944cd
#1876 Add FlexibleDeploymentPatch
DmytroNazarenko Apr 24, 2024
b6dee22
#1719 fix tests
olehnikolaiev Apr 24, 2024
804aef3
IS-864 bls sync config
olehnikolaiev Apr 24, 2024
8e0eeff
#1719 fix historic node
olehnikolaiev Apr 25, 2024
c928244
#1876 Pass 2 parameters if patch is enabled
DmytroNazarenko Apr 25, 2024
b44e87f
SKALED-1878 Colorful logs
dimalit Apr 28, 2024
bdbd077
Merge pull request #1880 from skalenetwork/enhancement/SKALED-1878-un…
dimalit Apr 29, 2024
1615a5e
#1719 fix txn proccessing
olehnikolaiev Apr 29, 2024
18847ba
#1719 fix eth_getBlockByNumber call
olehnikolaiev Apr 30, 2024
bcc31af
#1719 fix getTransaction
olehnikolaiev Apr 30, 2024
a1e8069
IS 864 better exception description
olehnikolaiev Apr 30, 2024
b427164
Merge branch 'v3.19.0' into feature/1719-eip1559
olehnikolaiev Apr 30, 2024
a7590fb
#1719 format code
olehnikolaiev Apr 30, 2024
3181ea4
#1719 small improvements
olehnikolaiev Apr 30, 2024
e544bda
SKALED-1877 Add blockHash support
dimalit May 2, 2024
0da8609
SKALED-1877 Fix wrong filter range
dimalit May 3, 2024
7d612ed
IS-864 bls sync config
olehnikolaiev May 3, 2024
fbb353c
SKALED-1877 Throw if blockHash doesn't exist or empty
dimalit May 3, 2024
55f1b96
Merge pull request #1884 from skalenetwork/feature/SKALED-1877-suppor…
dimalit May 4, 2024
d7ba751
Merge branch 'v3.19.0' into feature/1719-eip1559
olehnikolaiev May 7, 2024
d385944
806 consensus improvements
kladkogex May 7, 2024
b488ef2
806 improve consensus
kladkogex May 7, 2024
aafb27c
#806 enable patches
kladkogex May 7, 2024
84e3099
806 fix patch names
kladkogex May 7, 2024
395b3a8
806 fix patch naming
kladkogex May 7, 2024
74d215d
806 improve consensus github flow
kladkogex May 7, 2024
03b289f
IS-864 add debug logs
olehnikolaiev May 9, 2024
d072ea5
IS-864 update consensus
olehnikolaiev May 9, 2024
df125fe
Merge branch 'v3.19.0' into bug/IS-864-bls-sync-config
olehnikolaiev May 9, 2024
779ecb0
#1876 Add unit test for new deployment control
DmytroNazarenko May 10, 2024
ec40d75
IS-864 Small code rearrangement
dimalit May 10, 2024
61b1389
Merge pull request #1894 from skalenetwork/bug/IS-864-bls-sync-config…
olehnikolaiev May 13, 2024
006c55a
Merge pull request #1869 from skalenetwork/feature/1719-eip1559
olehnikolaiev May 13, 2024
b40c2a5
Merge branch 'v3.19.0' into bug/IS-864-bls-sync-config
olehnikolaiev May 13, 2024
fa24eab
#1876 Change call signature
DmytroNazarenko May 13, 2024
d678d09
IS 864 fix typo after merge
olehnikolaiev May 13, 2024
0c1e7ba
#1876 Change call signature
DmytroNazarenko May 13, 2024
af986c1
806 consensus improvements
kladkogex May 13, 2024
bf916a5
#1876 Update unit test
DmytroNazarenko May 13, 2024
994c436
#1876 Update unit test
DmytroNazarenko May 13, 2024
4237344
#1876 Update unit test
DmytroNazarenko May 13, 2024
33af97e
Merge branch 'v3.19.0' into enhancement/new-deploy-management
DmytroNazarenko May 13, 2024
03900a6
#1876 Add comments
DmytroNazarenko May 13, 2024
aa957df
#1876 Update comments
DmytroNazarenko May 14, 2024
538f60b
IS 864 add new config variable
olehnikolaiev May 15, 2024
e1f053a
Merge pull request #1893 from skalenetwork/enhancement/new-deploy-man…
DmytroNazarenko May 15, 2024
a88f7da
IS 864 functional tests
olehnikolaiev May 15, 2024
cef9482
806 update consensus
kladkogex May 16, 2024
d1afffa
Merge branch 'v3.19.0' into 806_consensus_improvements
kladkogex May 16, 2024
b19165b
Updated consensus
kladkogex May 16, 2024
543907d
806b fix build
kladkogex May 16, 2024
360f8d8
IS 864 update skale-ci-integrations ref
olehnikolaiev May 16, 2024
63eaca4
Merge branch 'v3.19.0' into bug/IS-864-bls-sync-config
olehnikolaiev May 16, 2024
2a2d16d
806 libconsensus
kladkogex May 16, 2024
35a2a78
Merge pull request #1891 from skalenetwork/bug/IS-864-bls-sync-config
DmytroNazarenko May 16, 2024
e5ba6b2
Merge branch 'v3.19.0' into 806_consensus_improvements
kladkogex May 16, 2024
932e183
Merge pull request #1888 from skalenetwork/806_consensus_improvements
DmytroNazarenko May 16, 2024
9d1d3cd
Merge branch 'v3.19.0' into develop-to-3.19.0
olehnikolaiev May 17, 2024
c60a824
Merge pull request #1902 from skalenetwork/develop-to-3.19.0
DmytroNazarenko May 17, 2024
e52fa44
Merge pull request #1901 from skalenetwork/v3.19.0
DmytroNazarenko May 17, 2024
421c5d1
Merge branch 'beta' into develop
DmytroNazarenko May 17, 2024
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 .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: skalenetwork/skale-ci-integration_tests
ref: v3.18.0
ref: master
submodules: recursive
- name: Set up Node
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.18.1
3.19.0
2 changes: 1 addition & 1 deletion libconsensus
Submodule libconsensus updated 52 files
+4 −1 .github/workflows/build.yml
+6 −0 .github/workflows/dockerimage.yml
+3 −0 .idea/misc.xml
+51 −41 .idea/workspace.xml
+3 −2 Consensust.cpp
+72 −11 chains/Schain.cpp
+17 −4 chains/Schain.h
+7 −2 chains/SchainGettersSetters.cpp
+9 −5 crypto/CryptoManager.cpp
+21 −0 datastructures/BooleanProposalVector.cpp
+2 −0 datastructures/BooleanProposalVector.h
+1 −1 datastructures/CommittedBlockList.cpp
+10 −0 db/BlockProposalDB.cpp
+441 −0 docs/consensus-spec.md
+124 −0 monitoring/OptimizerAgent.cpp
+48 −0 monitoring/OptimizerAgent.h
+0 −2 network/Network.cpp
+18 −15 node/ConsensusEngine.cpp
+1 −1 node/ConsensusEngine.h
+10 −1 node/Node.cpp
+75 −61 pendingqueue/PendingTransactionsAgent.cpp
+17 −16 pendingqueue/TestMessageGeneratorAgent.cpp
+6 −0 pendingqueue/TestMessageGeneratorAgent.h
+135 −71 protocols/blockconsensus/BlockConsensusAgent.cpp
+11 −0 protocols/blockconsensus/BlockConsensusAgent.h
+3 −1 test/11_out_of_16/node1/Node.json
+3 −1 test/11_out_of_16/node10/Node.json
+3 −1 test/11_out_of_16/node11/Node.json
+3 −1 test/11_out_of_16/node2/Node.json
+3 −1 test/11_out_of_16/node3/Node.json
+3 −1 test/11_out_of_16/node4/Node.json
+3 −1 test/11_out_of_16/node5/Node.json
+3 −1 test/11_out_of_16/node6/Node.json
+3 −1 test/11_out_of_16/node7/Node.json
+3 −1 test/11_out_of_16/node8/Node.json
+3 −1 test/11_out_of_16/node9/Node.json
+3 −1 test/sixteennodes/node01/Node.json
+3 −1 test/sixteennodes/node02/Node.json
+3 −1 test/sixteennodes/node03/Node.json
+3 −1 test/sixteennodes/node04/Node.json
+3 −1 test/sixteennodes/node05/Node.json
+3 −1 test/sixteennodes/node06/Node.json
+3 −1 test/sixteennodes/node07/Node.json
+3 −1 test/sixteennodes/node08/Node.json
+3 −1 test/sixteennodes/node09/Node.json
+3 −1 test/sixteennodes/node10/Node.json
+3 −1 test/sixteennodes/node11/Node.json
+3 −1 test/sixteennodes/node12/Node.json
+3 −1 test/sixteennodes/node13/Node.json
+3 −1 test/sixteennodes/node14/Node.json
+3 −1 test/sixteennodes/node15/Node.json
+2 −1 test/sixteennodes/node16/Node.json
6 changes: 4 additions & 2 deletions libdevcore/JsonUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ std::string dev::jsonTypeAsString( json_spirit::Value_type _type ) {
}

void dev::requireJsonFields( json_spirit::mObject const& _o, std::string const& _config,
std::map< std::string, JsonFieldOptions > const& _validationMap ) {
std::map< std::string, JsonFieldOptions > const& _validationMap,
std::function< bool( const std::string& ) > _callbackForUnexpected ) {
// check for unexpected fiedls
for ( auto const& field : _o ) {
if ( !_validationMap.count( field.first ) ) {
// _callbackForUnexpected allows to accept ertain unexpected fields
if ( !_validationMap.count( field.first ) && !_callbackForUnexpected( field.first ) ) {
std::string const comment =
"Unexpected field '" + field.first + "' in config: " + _config;
cerror << comment << "\n"
Expand Down
8 changes: 6 additions & 2 deletions libdevcore/JsonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ using JsonFieldOptions = std::pair< JsonTypeSet, JsonFieldPresence >;
@param _validationMap a map with json objects that would be checked. "objName" -> {js::str_type,
jsonField::Required}
*/
void requireJsonFields( json_spirit::mObject const& _o, std::string const& _configName,
std::map< std::string, JsonFieldOptions > const& _validationMap );
void requireJsonFields(
json_spirit::mObject const& _o, std::string const& _configName,
std::map< std::string, JsonFieldOptions > const& _validationMap,
std::function< bool( const std::string& ) > _callbackForUnexpected = []( const std::string& ) {
return false;
} );
} // namespace dev
2 changes: 1 addition & 1 deletion libdevcore/LevelDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <leveldb/write_batch.h>
#include <boost/filesystem.hpp>

#include "shared_mutex"
#include <secp256k1_sha256.h>
#include <shared_mutex>

namespace dev::db {
class LevelDB : public DatabaseFace {
Expand Down
12 changes: 0 additions & 12 deletions libethashseal/Ethash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,6 @@ void Ethash::verify( Strictness _s, BlockHeader const& _bi, BlockHeader const& _
}
}

void Ethash::verifyTransaction( ImportRequirements::value _ir, TransactionBase const& _t,
BlockHeader const& _header, u256 const& _startGasUsed ) const {
SealEngineFace::verifyTransaction( _ir, _t, _header, _startGasUsed );

if ( _ir & ImportRequirements::TransactionSignatures ) {
if ( _header.number() >= chainParams().EIP158ForkBlock ) {
uint64_t chainID = chainParams().chainID;
_t.checkChainId( chainID, chainParams().skaleDisableChainIdCheck );
} // if
}
}

u256 Ethash::childGasLimit( BlockHeader const& _bi, u256 const& _gasFloorTarget ) const {
u256 gasFloorTarget = _gasFloorTarget == Invalid256 ? 3141562 : _gasFloorTarget;
u256 gasLimit = _bi.gasLimit();
Expand Down
2 changes: 0 additions & 2 deletions libethashseal/Ethash.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class Ethash : public SealEngineBase {
StringHashMap jsInfo( BlockHeader const& _bi ) const override;
void verify( Strictness _s, BlockHeader const& _bi, BlockHeader const& _parent,
bytesConstRef _block ) const override;
void verifyTransaction( ImportRequirements::value _ir, TransactionBase const& _t,
BlockHeader const& _header, u256 const& _startGasUsed ) const override;
void populateFromParent( BlockHeader& _bi, BlockHeader const& _parent ) const override;

strings sealers() const override;
Expand Down
83 changes: 47 additions & 36 deletions libethcore/ChainOperationParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/

#include "ChainOperationParams.h"

#include <libethereum/SchainPatch.h>

#include <libdevcore/CommonData.h>
#include <libdevcore/Log.h>

Expand All @@ -42,6 +45,14 @@ PrecompiledContract::PrecompiledContract( unsigned _base, unsigned _word,
},
_exec, _startingBlock, _allowedAddresses ) {}

time_t SChain::getPatchTimestamp( SchainPatchEnum _patchEnum ) const {
assert( _patchEnum < SchainPatchEnum::PatchesCount );
if ( _patchEnum < SchainPatchEnum::PatchesCount )
return _patchTimestamps[static_cast< size_t >( _patchEnum )];
else
return 0;
}

ChainOperationParams::ChainOperationParams()
: m_blockReward( "0x4563918244F40000" ),
minGasLimit( 0x1388 ),
Expand All @@ -52,43 +63,33 @@ ChainOperationParams::ChainOperationParams()
difficultyBoundDivisor( 0x0800 ),
durationLimit( 0x0d ) {}

EVMSchedule const& ChainOperationParams::scheduleForBlockNumber( u256 const& _blockNumber ) const {
if ( _blockNumber >= skaleUnlimitedForkBlock )
return SkaleSchedule_Unlimited;
else if ( _blockNumber >= skale1024ForkBlock )
return SkaleSchedule_1024k;
else if ( _blockNumber >= skale512ForkBlock )
return SkaleSchedule_512k;
else if ( _blockNumber >= skale256ForkBlock )
return SkaleSchedule_256k;
else if ( _blockNumber >= skale128ForkBlock )
return SkaleSchedule_128k;
else if ( _blockNumber >= skale64ForkBlock )
return SkaleSchedule_64k;
else if ( _blockNumber >= skale32ForkBlock )
return SkaleSchedule_32k;
else if ( _blockNumber >= skale16ForkBlock )
return SkaleSchedule_16k;
else if ( _blockNumber >= experimentalForkBlock )
return ExperimentalSchedule;
else if ( _blockNumber >= istanbulForkBlock )
return IstanbulSchedule;
else if ( _blockNumber >= constantinopleFixForkBlock )
return ConstantinopleFixSchedule;
else if ( _blockNumber >= constantinopleForkBlock )
return ConstantinopleSchedule;
else if ( _blockNumber >= eWASMForkBlock )
return EWASMSchedule;
else if ( _blockNumber >= byzantiumForkBlock )
return ByzantiumSchedule;
else if ( _blockNumber >= EIP158ForkBlock )
return EIP158Schedule;
else if ( _blockNumber >= EIP150ForkBlock )
return EIP150Schedule;
else if ( _blockNumber >= homesteadForkBlock )
return HomesteadSchedule;
EVMSchedule const ChainOperationParams::makeEvmSchedule(
time_t _committedBlockTimestamp, u256 const& _workingBlockNumber ) const {
EVMSchedule result;

// 1 decide by block number
if ( _workingBlockNumber >= experimentalForkBlock )
result = ExperimentalSchedule;
else if ( _workingBlockNumber >= istanbulForkBlock )
result = IstanbulSchedule;
else if ( _workingBlockNumber >= constantinopleFixForkBlock )
result = ConstantinopleFixSchedule;
else if ( _workingBlockNumber >= constantinopleForkBlock )
result = ConstantinopleSchedule;
else if ( _workingBlockNumber >= byzantiumForkBlock )
result = ByzantiumSchedule;
else if ( _workingBlockNumber >= EIP158ForkBlock )
result = EIP158Schedule;
else if ( _workingBlockNumber >= EIP150ForkBlock )
result = EIP150Schedule;
else
return FrontierSchedule;
result = HomesteadSchedule;

// 2 based on previous - decide by timestamp
if ( PushZeroPatch::isEnabledWhen( _committedBlockTimestamp ) )
result = PushZeroPatch::makeSchedule( result );

return result;
}

u256 ChainOperationParams::blockReward( EVMSchedule const& _schedule ) const {
Expand All @@ -98,6 +99,16 @@ u256 ChainOperationParams::blockReward( EVMSchedule const& _schedule ) const {
return m_blockReward;
}

u256 ChainOperationParams::blockReward(
time_t _committedBlockTimestamp, u256 const& _workingBlockNumber ) const {
EVMSchedule const& schedule{ makeEvmSchedule( _committedBlockTimestamp, _workingBlockNumber ) };
return blockReward( schedule );
}

void ChainOperationParams::setBlockReward( u256 const& _newBlockReward ) {
m_blockReward = _newBlockReward;
}

time_t ChainOperationParams::getPatchTimestamp( SchainPatchEnum _patchEnum ) const {
return sChain.getPatchTimestamp( _patchEnum );
}
45 changes: 33 additions & 12 deletions libethcore/ChainOperationParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <libdevcore/Common.h>
#include <libethereum/Precompiled.h>
#include <libethereum/SchainPatchEnum.h>

#include "libethcore/Common.h"
#include "libethcore/EVMSchedule.h"
Expand Down Expand Up @@ -89,6 +90,7 @@ struct NodeInfo {
bool syncNode;
bool archiveMode;
bool syncFromCatchup;
bool testSignatures;

NodeInfo( std::string _name = "TestNode", u256 _id = 1, std::string _ip = "127.0.0.11",
uint16_t _port = 11111, std::string _ip6 = "::1", uint16_t _port6 = 11111,
Expand All @@ -106,7 +108,8 @@ struct NodeInfo {
"11559732032986387107991004021392285783925812861821192530917403151452391805634",
"8495653923123431417604973247489272438418190587263600148770280649306958101930",
"4082367875863433681332203403145435568316851327593401208105741076214120093531" },
bool _syncNode = false, bool _archiveMode = false, bool _syncFromCatchup = false ) {
bool _syncNode = false, bool _archiveMode = false, bool _syncFromCatchup = false,
bool _testSignatures = true ) {
name = _name;
id = _id;
ip = _ip;
Expand All @@ -121,6 +124,7 @@ struct NodeInfo {
syncNode = _syncNode;
archiveMode = _archiveMode;
syncFromCatchup = _syncFromCatchup;
testSignatures = _testSignatures;
}
};

Expand Down Expand Up @@ -173,16 +177,12 @@ struct SChain {
int emptyBlockIntervalMs = -1;
int64_t levelDBReopenIntervalMs = -1;
size_t t = 1;
time_t revertableFSPatchTimestamp = 0;
time_t contractStoragePatchTimestamp = 0;
time_t contractStorageZeroValuePatchTimestamp = 0;
time_t verifyDaSigsPatchTimestamp = 0;
time_t storageDestructionPatchTimestamp = 0;
time_t powCheckPatchTimestamp = 0;
time_t precompiledConfigPatchTimestamp = 0;
time_t pushZeroPatchTimestamp = 0;
time_t skipInvalidTransactionsPatchTimestamp = 0;
time_t correctForkInPowPatchTimestamp = 0;

// key is patch name
// public - for tests, don't access it directly
std::vector< time_t > _patchTimestamps =
std::vector< time_t >( static_cast< int >( SchainPatchEnum::PatchesCount ) );
time_t getPatchTimestamp( SchainPatchEnum _patchEnum ) const;

SChain() {
name = "TestChain";
Expand Down Expand Up @@ -210,8 +210,10 @@ struct ChainOperationParams {
u256 m_blockReward;

public:
EVMSchedule const& scheduleForBlockNumber( u256 const& _blockNumber ) const;
EVMSchedule const makeEvmSchedule(
time_t _committedBlockTimestamp, u256 const& _workingBlockNumber ) const;
u256 blockReward( EVMSchedule const& _schedule ) const;
u256 blockReward( time_t _committedBlockTimestamp, u256 const& _workingBlockNumber ) const;
void setBlockReward( u256 const& _newBlockReward );
u256 maximumExtraDataSize = 1024;
u256 accountStartNonce = 0;
Expand Down Expand Up @@ -257,6 +259,25 @@ struct ChainOperationParams {
u256 externalGasDifficulty = ~u256( 0 );
typedef std::vector< std::string > vecAdminOrigins_t;
vecAdminOrigins_t vecAdminOrigins; // wildcard based folters for IP addresses
int getLogsBlocksLimit = -1;

time_t getPatchTimestamp( SchainPatchEnum _patchEnum ) const;

bool isPrecompiled( Address const& _a, u256 const& _blockNumber ) const {
return precompiled.count( _a ) != 0 && _blockNumber >= precompiled.at( _a ).startingBlock();
}
bigint costOfPrecompiled(
Address const& _a, bytesConstRef _in, u256 const& _blockNumber ) const {
return precompiled.at( _a ).cost( _in, *this, _blockNumber );
}
std::pair< bool, bytes > executePrecompiled(
Address const& _a, bytesConstRef _in, u256 const& ) const {
return precompiled.at( _a ).execute( _in );
}
bool precompiledExecutionAllowedFrom(
Address const& _a, Address const& _from, bool _readOnly ) const {
return precompiled.at( _a ).executionAllowedFrom( _from, _readOnly );
}
};

} // namespace eth
Expand Down
17 changes: 17 additions & 0 deletions libethcore/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,26 @@ std::string formatBalance( bigint const& _b ) {
}

bytes isAddressWhitelistedCallData( Address const& _deployer ) {
// Generating calldata for isAddressWhitelisted contract call:
// 13f44d1 - selector of isAddressWhitelisted function
// 000000000000000000000000 - 12-byte offset for sender address
// _deployer - 20-byte sender address

return fromHex( "13f44d10000000000000000000000000" + _deployer.hex() );
}

bytes isDeploymentAllowedCallData( Address const& _origin, Address const& _deployer ) {
// Generating calldata for isDeploymentAllowed contract call:
// d0f557f4 - selector of isDeploymentAllowed function
// 000000000000000000000000 - 12-byte offset for origin address
// _origin - 20-byte origin address
// 000000000000000000000000 - 12-byte offset for sender address
// _deployer - 20-byte sender address

return fromHex( "d0f557f4000000000000000000000000" + _origin.hex() +
"000000000000000000000000" + _deployer.hex() );
}

bytes getMultitransactionCallData() {
return fromHex( "0xbad0396e" );
}
Expand Down
5 changes: 4 additions & 1 deletion libethcore/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ extern const bytes c_blockhashContractCode;
/// Address of the special contract for deployment control
extern const Address c_configControllerContractAddress;

/// Formatting call data for deployment control contract
/// Generating call data for deployment control contract
bytes isAddressWhitelistedCallData( Address const& _deployer );

/// Generating calldata for deployment control contract, considering tx origin
bytes isDeploymentAllowedCallData( Address const& _origin, Address const& _deployer );

/// Formatting call data for multitransaction contract
bytes getMultitransactionCallData();

Expand Down
Loading
Loading