Skip to content

Commit e467a34

Browse files
Merge branch 'develop' into feat/updraft-addition
2 parents aa4d55b + 635fe8f commit e467a34

File tree

10 files changed

+33
-51
lines changed

10 files changed

+33
-51
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ defaults:
779779
name: t_native_test_ext_ens
780780
project: ens
781781
binary_type: native
782-
image: cimg/node:18.16
782+
image: cimg/node:lts
783783

784784
- job_native_compile_ext_trident: &job_native_compile_ext_trident
785785
<<: *requires_b_ubu_static

docs/introduction-to-smart-contracts.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ This contract introduces some new concepts, let us go through them one by one.
131131
The line ``address public minter;`` declares a state variable of type :ref:`address<address>`.
132132
The ``address`` type is a 160-bit value that does not allow any arithmetic operations.
133133
It is suitable for storing addresses of contracts, or a hash of the public half
134-
of a keypair belonging to :ref:`external accounts<accounts>`.
134+
of a keypair belonging to :ref:`externally-owned accounts<accounts>`.
135135

136136
The keyword ``public`` automatically generates a function that allows you to access the current value of the state
137137
variable from outside of the contract. Without this keyword, other contracts have no way to access the variable.
@@ -338,11 +338,11 @@ Accounts
338338
========
339339

340340
There are two kinds of accounts in Ethereum which share the same
341-
address space: **External accounts** that are controlled by
341+
address space: **Externally-owned accounts** that are controlled by
342342
public-private key pairs (i.e. humans) and **contract accounts** which are
343343
controlled by the code stored together with the account.
344344

345-
The address of an external account is determined from
345+
The address of an externally-owned account is determined from
346346
the public key while the address of a contract is
347347
determined at the time the contract is created
348348
(it is derived from the creator address and the number

docs/security-considerations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Please be explicit about such cases in the documentation of your contracts.
144144
Sending and Receiving Ether
145145
===========================
146146

147-
- Neither contracts nor "external accounts" are currently able to prevent someone from sending them Ether.
147+
- Neither contracts nor "externally-owned accounts" are currently able to prevent someone from sending them Ether.
148148
Contracts can react on and reject a regular transfer, but there are ways to move Ether without creating a message call.
149149
One way is to simply "mine to" the contract address and the second way is using ``selfdestruct(x)``.
150150

libsolidity/formal/CHC.h

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,10 @@ class CHC: public SMTEncoder
7474

7575
friend bool operator<(CHCVerificationTarget const& _a, CHCVerificationTarget const& _b)
7676
{
77-
return _a.errorId < _b.errorId;
78-
}
79-
};
80-
81-
struct SafeTargetsCompare
82-
{
83-
bool operator()(CHCVerificationTarget const & _lhs, CHCVerificationTarget const & _rhs) const
84-
{
85-
if (_lhs.errorNode->id() == _rhs.errorNode->id())
86-
return _lhs.type < _rhs.type;
77+
if (_a.errorNode->id() == _b.errorNode->id())
78+
return _a.type < _b.type;
8779
else
88-
return _lhs.errorNode->id() == _rhs.errorNode->id();
80+
return _a.errorNode->id() < _b.errorNode->id();
8981
}
9082
};
9183

@@ -96,7 +88,7 @@ class CHC: public SMTEncoder
9688
std::string message;
9789
};
9890

99-
std::map<ASTNode const*, std::set<CHCVerificationTarget, SafeTargetsCompare>, smt::EncodingContext::IdCompare> const& safeTargets() const { return m_safeTargets; }
91+
std::map<ASTNode const*, std::set<CHCVerificationTarget>, smt::EncodingContext::IdCompare> const& safeTargets() const { return m_safeTargets; }
10092
std::map<ASTNode const*, std::map<VerificationTargetType, ReportTargetInfo>, smt::EncodingContext::IdCompare> const& unsafeTargets() const { return m_unsafeTargets; }
10193

10294
/// This is used if the Horn solver is not directly linked into this binary.
@@ -434,7 +426,7 @@ class CHC: public SMTEncoder
434426
std::map<unsigned, CHCVerificationTarget> m_verificationTargets;
435427

436428
/// Targets proved safe.
437-
std::map<ASTNode const*, std::set<CHCVerificationTarget, SafeTargetsCompare>, smt::EncodingContext::IdCompare> m_safeTargets;
429+
std::map<ASTNode const*, std::set<CHCVerificationTarget>, smt::EncodingContext::IdCompare> m_safeTargets;
438430
/// Targets proved unsafe.
439431
std::map<ASTNode const*, std::map<VerificationTargetType, ReportTargetInfo>, smt::EncodingContext::IdCompare> m_unsafeTargets;
440432
/// Targets not proved.

libyul/backends/evm/SSAControlFlowGraphBuilder.cpp

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ SSACFG::ValueId SSAControlFlowGraphBuilder::tryRemoveTrivialPhi(SSACFG::ValueId
109109

110110
m_graph.block(phiInfo->block).phis.erase(_phi);
111111

112-
std::set<SSACFG::ValueId> phiUses;
112+
std::vector<SSACFG::ValueId> phiUses;
113113
for (size_t blockIdValue = 0; blockIdValue < m_graph.numBlocks(); ++blockIdValue)
114114
{
115115
auto& block = m_graph.block(SSACFG::BlockId{blockIdValue});
@@ -126,18 +126,13 @@ SSACFG::ValueId SSAControlFlowGraphBuilder::tryRemoveTrivialPhi(SSACFG::ValueId
126126
usedInPhi = true;
127127
}
128128
if (usedInPhi)
129-
phiUses.emplace(blockPhi);
129+
phiUses.push_back(blockPhi);
130130
}
131131
for (auto& op: block.operations)
132-
std::replace(op.inputs.begin(), op.inputs.end(), _phi, same);
132+
ranges::replace(op.inputs, _phi, same);
133133
std::visit(util::GenericVisitor{
134134
[_phi, same](SSACFG::BasicBlock::FunctionReturn& _functionReturn) {
135-
std::replace(
136-
_functionReturn.returnValues.begin(),
137-
_functionReturn.returnValues.end(),
138-
_phi,
139-
same
140-
);
135+
ranges::replace(_functionReturn.returnValues,_phi, same);
141136
},
142137
[_phi, same](SSACFG::BasicBlock::ConditionalJump& _condJump) {
143138
if (_condJump.condition == _phi)
@@ -188,22 +183,17 @@ void SSAControlFlowGraphBuilder::cleanUnreachable()
188183
{
189184
auto& block = m_graph.block(blockId);
190185

191-
std::set<SSACFG::ValueId> maybeTrivialPhi;
192-
for (auto it = block.entries.begin(); it != block.entries.end();)
193-
if (reachabilityCheck.visited.count(*it))
194-
it++;
195-
else
196-
it = block.entries.erase(it);
186+
std::vector<SSACFG::ValueId> maybeTrivialPhi;
187+
std::erase_if(block.entries, [&](auto const& entry) { return !reachabilityCheck.visited.contains(entry); });
197188
for (auto phi: block.phis)
198189
if (auto* phiInfo = std::get_if<SSACFG::PhiValue>(&m_graph.valueInfo(phi)))
199-
std::erase_if(phiInfo->arguments, [&](SSACFG::ValueId _arg) {
200-
if (std::holds_alternative<SSACFG::UnreachableValue>(m_graph.valueInfo(_arg)))
201-
{
202-
maybeTrivialPhi.insert(phi);
203-
return true;
204-
}
205-
return false;
190+
{
191+
auto erasedCount = std::erase_if(phiInfo->arguments, [&](SSACFG::ValueId _arg) {
192+
return std::holds_alternative<SSACFG::UnreachableValue>(m_graph.valueInfo(_arg));
206193
});
194+
if (erasedCount > 0)
195+
maybeTrivialPhi.push_back(phi);
196+
}
207197

208198
// After removing a phi argument, we might end up with a trivial phi that can be removed.
209199
for (auto phi: maybeTrivialPhi)

libyul/backends/evm/StackLayoutGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Stack StackLayoutGenerator::propagateStackThroughOperation(Stack _exitStack, CFG
308308
// generated on the fly), s.t. shuffling the `stack + _operation.output` to _exitLayout is cheap.
309309
Stack stack = createIdealLayout(_operation.output, _exitStack, generateSlotOnTheFly, reachableStackDepth());
310310

311-
// Make sure the resulting previous slots do not overlap with any assignmed variables.
311+
// Make sure the resulting previous slots do not overlap with any assigned variables.
312312
if (auto const* assignment = std::get_if<CFG::Assignment>(&_operation.operation))
313313
for (auto& stackSlot: stack)
314314
if (auto const* varSlot = std::get_if<VariableSlot>(&stackSlot))

scripts/regressions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ def __init__(self, interval=300):
2222
thread.start()
2323

2424
def run(self):
25-
""" Runs until the main Python thread exits. """
26-
## Print a newline at the very beginning.
25+
""" Run indefinitely until the main Python thread exits. """
26+
## Print an initial newline at the very beginning.
2727
print("")
2828
while True:
2929
# Print dot
3030
print(".")
3131
time.sleep(self.interval)
3232

33-
class regressor:
33+
class Regressor:
3434
_re_sanitizer_log = re.compile(r"""ERROR: (libFuzzer|UndefinedBehaviorSanitizer)""")
3535

3636
def __init__(self, description, args):
@@ -87,7 +87,7 @@ def process_log(self, logfile):
8787
False -> Failure
8888
"""
8989

90-
## Log may contain non ASCII characters, so we simply stringify them
90+
## Log may contain non-ASCII characters, so we simply stringify them
9191
## since they don't matter for regular expression matching
9292
with open(logfile, 'rb', encoding=None) as f:
9393
rawtext = str(f.read())
@@ -122,5 +122,5 @@ def run(self):
122122

123123
if __name__ == '__main__':
124124
dotprinter = PrintDotsThread()
125-
tool = regressor(DESCRIPTION, sys.argv[1:])
125+
tool = Regressor(DESCRIPTION, sys.argv[1:])
126126
sys.exit(not tool.run())

scripts/splitSources.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
#
33
# This script reads a syntaxTest file and writes all
4-
# sources into their own files. If one source-name specifies subdirectories
4+
# sources into separate files. If a source name specifies subdirectories,
55
# those will be created too.
66

77
# Usage: scripts/splitSources.py pathToTestfile
@@ -18,7 +18,7 @@ def uncaught_exception_hook(exc_type, exc_value, exc_traceback):
1818
# The script `scripts/ASTImportTest.sh` will interpret return code 3
1919
# as a critical error (because of the uncaught exception) and will
2020
# terminate further execution.
21-
print("Unhandled exception: %s", "".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))
21+
print("Unhandled exception: " + "".join(traceback.format_exception(exc_type, exc_value, exc_traceback)))
2222
sys.exit(3)
2323

2424

@@ -42,7 +42,7 @@ def writeSourceToFile(lines):
4242
with open(srcName, mode='a+', encoding='utf8', newline='') as f:
4343
for idx, line in enumerate(lines[1:]):
4444
# write to file
45-
if line[:12] != "==== Source:":
45+
if not line.startswith("==== Source:"):
4646
f.write(line + '\n')
4747

4848
# recursive call if there is another source

test/compilationTests/corion/provider.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ contract provider is module, safeMath, announcementTypes {
185185
}
186186
function setRightForInterest(uint256 oldValue, uint256 newValue, bool priv) internal {
187187
/*
188-
It checks if the provider has enough connected captital to be able to get from the token emission.
188+
It checks if the provider has enough connected capital to be able to get from the token emission.
189189
In case the provider is not able to get the share from the token emission then the connected capital will not count to the value of the globalFunds, to the current schelling round.
190190
191191
@oldValue old

test/compilationTests/corion/schelling.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ contract schelling is module, announcementTypes, schellingVars {
256256
@_moduleHandler Address of ModuleHandler.
257257
@_db Address of the database.
258258
@_forReplace This address will be replaced with the old one or not.
259-
@_icoExpansionAddress This address can turn schelling runds during ICO.
259+
@_icoExpansionAddress This address can turn schelling funds during ICO.
260260
*/
261261
db = schellingDB(_db);
262262
super.registerModuleHandler(_moduleHandler);

0 commit comments

Comments
 (0)