Skip to content

Commit

Permalink
Merge pull request #71 from rsksmart/IRIS-3.2.0-rc-with-master
Browse files Browse the repository at this point in the history
Iris 3.2.0 rc with master
  • Loading branch information
marcos-iov authored Jan 31, 2022
2 parents aeb5b7f + 9c98db7 commit de970f1
Show file tree
Hide file tree
Showing 13 changed files with 682 additions and 526 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tasks.withType(AbstractArchiveTask) {

ext {
bitcoinjcoreVersion = '0.15.6-rsk-2'
bitcoinjVersion = '0.14.4-rsk-10'
bitcoinjVersion = '0.14.4-rsk-11'
commonsLang3Version = '3.5'
commonsIoVersion = '2.5'
slf4jVersion = '1.7.25'
Expand Down
147 changes: 11 additions & 136 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<trust file=".*-javadoc[.]jar" regex="true"/>
<trust file=".*-sources[.]jar" regex="true"/>
<trust group="co.rsk" name="rskj-core" version=".+-SNAPSHOT" regex="true"/>
<trust group="co.rsk" name="rskj-core" version=".+-RC" regex="true"/>
</trusted-artifacts>
</configuration>
<components>
Expand Down Expand Up @@ -47,20 +48,20 @@
<sha256 value="6f9c5578df1e4dd58debf5b6693e88cd7a76653908e8e675e9a74ca093231aae" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="co.rsk" name="rskj-core" version="3.0.0-IRIS">
<artifact name="rskj-core-3.0.0-IRIS.jar">
<sha256 value="d9b66f76e1aa0aca88d276f92e5de63b0b28a0f1412db3ea5e6fdd91d69528cb" origin="Generated by Gradle"/>
<component group="co.rsk" name="rskj-core" version="3.2.0-IRIS">
<artifact name="rskj-core-3.2.0-IRIS.jar">
<sha256 value="3a0b939f66df64a06e406d453fa668a1f4c8675a3f631b1b5659beb220fb185b" origin="Generated by Gradle"/>
</artifact>
<artifact name="rskj-core-3.0.0-IRIS.pom">
<sha256 value="876f981c5d5e9dfa6285393aff271f8ae197cc3550d53d77f13e2c4f2d44a38f" origin="Generated by Gradle"/>
<artifact name="rskj-core-3.2.0-IRIS.module">
<sha256 value="af363c8c20415edb3b714ea88753cf65fedcf1917928d97d4c29353192ed8603" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="co.rsk.bitcoinj" name="bitcoinj-thin" version="0.14.4-rsk-10">
<artifact name="bitcoinj-thin-0.14.4-rsk-10.jar">
<sha256 value="dea3df78f99af2fd44108d37a832885d2631ea59d4a933a42c95832997d711cb" origin="Generated by Gradle"/>
<component group="co.rsk.bitcoinj" name="bitcoinj-thin" version="0.14.4-rsk-11">
<artifact name="bitcoinj-thin-0.14.4-rsk-11.jar">
<sha256 value="7c791512ae18f5adec0b7f18ba49ab7c6cddac334b48816a532eceec0f44e10b" origin="Generated by Gradle"/>
</artifact>
<artifact name="bitcoinj-thin-0.14.4-rsk-10.pom">
<sha256 value="15731d1a14720c34b9f49686ff5c4167c52dc616fe13c342acfc9d58f227f455" origin="Generated by Gradle"/>
<artifact name="bitcoinj-thin-0.14.4-rsk-11.pom">
<sha256 value="b58375898eb88ed528d29cb337c1d3275ee93b7a9b5572633281eca94104c5fb" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml" name="oss-parent" version="27">
Expand Down Expand Up @@ -458,11 +459,6 @@
<sha256 value="28ebb2998bc7d7acb25078526971640892000f3413586ff42d611f1043bfec30" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.airlift" name="airbase" version="28">
<artifact name="airbase-28.pom">
<sha256 value="66af780c8ebeea80fc472c6214b938b7b120a69768b8ccce4445fb881befecb5" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-buffer" version="4.0.56.Final">
<artifact name="netty-buffer-4.0.56.Final.jar">
<sha256 value="055f5ccfd7f9683c5d961fbf4466778d5b91ebf8b1f2ddd2eed539a82352b695" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -759,37 +755,6 @@
<sha256 value="94995574dce953f86fde5c527b50494054f17e5401c0f725f90b857317ef94aa" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.fusesource" name="fusesource-pom" version="1.9">
<artifact name="fusesource-pom-1.9.pom">
<sha256 value="69022c7dd091ebb2b27f6b74709b19435e4c2e86cb6b5e698ce8f37258c60363" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.fusesource.hawtjni" name="hawtjni-project" version="1.9">
<artifact name="hawtjni-project-1.9.pom">
<sha256 value="9cb61fd058542f62058b9f803a1eb5b894a67ef06e63d90e09f4f7459a7fcca7" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.fusesource.hawtjni" name="hawtjni-runtime" version="1.9">
<artifact name="hawtjni-runtime-1.9.jar">
<sha256 value="74fe9764e1fb1ef20b159dbca2d29abd6de292082ce3fcf538f81ac912390416" origin="Generated by Gradle"/>
</artifact>
<artifact name="hawtjni-runtime-1.9.pom">
<sha256 value="0c1d9f740fa3b7b9018292236d87ff451cdc2c4facaf0c2e6f3f7f1c4532bf68" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.fusesource.leveldbjni" name="leveldbjni" version="1.8">
<artifact name="leveldbjni-1.8.jar">
<sha256 value="05fe3a006d030aaf8d1e43f6c640a85f9f6b967c4499ce1ad5055ac236c3b944" origin="Generated by Gradle"/>
</artifact>
<artifact name="leveldbjni-1.8.pom">
<sha256 value="f498b8df49f5b89d7e470d2232cd40f364af0623a83783c8a60d97dfedc77221" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.fusesource.leveldbjni" name="leveldbjni-project" version="1.8">
<artifact name="leveldbjni-project-1.8.pom">
<sha256 value="1a0c104ca7db4756e323888fb5dcff0839bee0f47aee309fa61bbe6b8d1f9e1b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.glassfish.external" name="management-api" version="3.2.2">
<artifact name="management-api-3.2.2.jar">
<sha256 value="fa6d8ea08f0c59b3570c223a7e60329e17046573b79064a76affc558640f02d9" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -861,35 +826,6 @@
<sha256 value="6d535f94efb663bdb682c9f27a50335394688009642ba7a9677504bc1be4129b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.iq80.leveldb" name="leveldb" version="0.9">
<artifact name="leveldb-0.9.jar">
<sha256 value="0dcc623fcb8450e736b9d2b1b8d91b980e44920d6a22cec8c00f703548b3747f" origin="Generated by Gradle"/>
</artifact>
<artifact name="leveldb-0.9.pom">
<sha256 value="50bc5a6fa4769b49d8e48238429011814e7c5826986dac92cf982e6bfdd84b8f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.iq80.leveldb" name="leveldb-api" version="0.9">
<artifact name="leveldb-api-0.9.jar">
<sha256 value="279e3a5649cde0bf0d4e09fd1369ec0e9ee80344ec06527c37148c9a58684140" origin="Generated by Gradle"/>
</artifact>
<artifact name="leveldb-api-0.9.pom">
<sha256 value="79e57fad4ee67ec82de74449d2077402415d52241dd1fffa585e7a5eaf13c6be" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.iq80.leveldb" name="leveldb-project" version="0.9">
<artifact name="leveldb-project-0.9.pom">
<sha256 value="27c70a5289a416365e56ddb51edfc1ac1432add5a5b9f1851eb2578d24ac35da" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.agent" version="0.8.5">
<artifact name="org.jacoco.agent-0.8.5.jar">
<sha256 value="852e1bf147fceab6caf7a82887dba2864d88bca6020524b67dddda073398d2f8" origin="Generated by Gradle"/>
</artifact>
<artifact name="org.jacoco.agent-0.8.5.pom">
<sha256 value="c3b2f50b692f2b081d85613527917bc6812f922e1da469a11682653b16f283fd" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.agent" version="0.8.7">
<artifact name="org.jacoco.agent-0.8.7.jar">
<sha256 value="9cbcc986e0fbe821a78ff1f8f7d5216f200e5eb124e7f6837d1dc4a77b28b143" origin="Generated by Gradle"/>
Expand All @@ -898,14 +834,6 @@
<sha256 value="e7b2cdd2df3a6bc239a231b1775be09e50b748e9c388579fb3ea4f990357722f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.ant" version="0.8.5">
<artifact name="org.jacoco.ant-0.8.5.jar">
<sha256 value="cd2289b9f955c8064054145f3871e18101840ae73ee6b9f835aea51573506cce" origin="Generated by Gradle"/>
</artifact>
<artifact name="org.jacoco.ant-0.8.5.pom">
<sha256 value="4b74fc5373ad70d387f3738ce0e9d4b170944039739e2b12a87c24202c002282" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.ant" version="0.8.7">
<artifact name="org.jacoco.ant-0.8.7.jar">
<sha256 value="97ca96a382c3f23a44d8eb4c4e6c3742a30cb8005774a76ced0fc4806ce49605" origin="Generated by Gradle"/>
Expand All @@ -914,24 +842,11 @@
<sha256 value="a6084588725cf7e9f28372d5f73eb90ea95ef91976f128fa8059f946831b1fb8" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.build" version="0.8.5">
<artifact name="org.jacoco.build-0.8.5.pom">
<sha256 value="ad6e40d227647ddbeb4f47a04d1002299986d127b7244f8b34d7b742ba1ac1ca" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.build" version="0.8.7">
<artifact name="org.jacoco.build-0.8.7.pom">
<sha256 value="83408107930e1683a9b7647da7ab75eb83d80fa470c1641b79b5aecbbef1b783" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.core" version="0.8.5">
<artifact name="org.jacoco.core-0.8.5.jar">
<sha256 value="945818d150f89c03359ee9089568b2b83b4df4752fced02e6323f271481f0ddd" origin="Generated by Gradle"/>
</artifact>
<artifact name="org.jacoco.core-0.8.5.pom">
<sha256 value="2df79bbe660731df5b4f7b8d343afff59aa8b7d9d552d9c2f6e94de71eb374ef" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.core" version="0.8.7">
<artifact name="org.jacoco.core-0.8.7.jar">
<sha256 value="ad7739b5fb5969aa1a8aead3d74ed54dc82ed012f1f10f336bd1b96e71c1a13c" origin="Generated by Gradle"/>
Expand All @@ -940,14 +855,6 @@
<sha256 value="6832c751d8cd6071af646fde63baa13bdd183693fd60f7757f68536e5f867825" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.report" version="0.8.5">
<artifact name="org.jacoco.report-0.8.5.jar">
<sha256 value="c83e687be88e74477519eb67e20cc77a98deefaed920cd2a5531863c23d95906" origin="Generated by Gradle"/>
</artifact>
<artifact name="org.jacoco.report-0.8.5.pom">
<sha256 value="574cc0a2a4e77a2939b2fc24cab92bca414d05d8a6ab9e48ffb8fbd7fe0ae725" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.report" version="0.8.7">
<artifact name="org.jacoco.report-0.8.7.jar">
<sha256 value="cc89258623700a6c932592153cb528785876b6da183d5431f97efbba6f020e5b" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1024,14 +931,6 @@
<sha256 value="0f8a1b116e760b8fe6389c51b84e4b07a70fc11082d4f936e453b583dd50b43b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm" version="7.2">
<artifact name="asm-7.2.jar">
<sha256 value="7e6cc9e92eb94d04e39356c6d8144ca058cda961c344a7f62166a405f3206672" origin="Generated by Gradle"/>
</artifact>
<artifact name="asm-7.2.pom">
<sha256 value="e9e529afbd4bc699f6a3380855d27d13017c360fdb68547e06d1c3842d84e262" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm" version="9.1">
<artifact name="asm-9.1.jar">
<sha256 value="cda4de455fab48ff0bcb7c48b4639447d4de859a7afc30a094a986f0936beba2" origin="Generated by Gradle"/>
Expand All @@ -1040,14 +939,6 @@
<sha256 value="c683a90dd68f2b1788cbdfc4647ea9405ef5925b371c199f8fd39d44d3cede8d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-analysis" version="7.2">
<artifact name="asm-analysis-7.2.jar">
<sha256 value="be922aae60ff1ff1768e8e6544a38a7f92bd0a6d6b0b9791f94955d1bd453de2" origin="Generated by Gradle"/>
</artifact>
<artifact name="asm-analysis-7.2.pom">
<sha256 value="71faa63489b3de4d6251581d2b26e87e0c167c5a08198ca62853fd83644d841f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-analysis" version="9.1">
<artifact name="asm-analysis-9.1.jar">
<sha256 value="81a88041b1b8beda5a8a99646098046c48709538270c49def68abff25ac3be34" origin="Generated by Gradle"/>
Expand All @@ -1056,14 +947,6 @@
<sha256 value="ac5454c11b03431ca951df71fb4e86c8c4c80df6979f95b757caed3ab0f47156" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-commons" version="7.2">
<artifact name="asm-commons-7.2.jar">
<sha256 value="0e86b8b179c5fb223d1a880a0ff4960b6978223984b94e62e71135f2d8ea3558" origin="Generated by Gradle"/>
</artifact>
<artifact name="asm-commons-7.2.pom">
<sha256 value="190ed352a8c20594b196b20194d06773b91c86b8d36868f937e5dbd0e9c0d78d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-commons" version="9.1">
<artifact name="asm-commons-9.1.jar">
<sha256 value="afcb26dc1fc12c0c4a99ada670908dd82e18dfc488caf5ee92546996b470c00c" origin="Generated by Gradle"/>
Expand All @@ -1072,14 +955,6 @@
<sha256 value="a0f651b27b8afe9c0e612d7a0266eacb5f7b1c787bc4b5ac8245f3d7a1181b7f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-tree" version="7.2">
<artifact name="asm-tree-7.2.jar">
<sha256 value="c063f5a67fa03cdc9bd79fd1c2ea6816cc4a19473ecdfbd9e9153b408c6f2656" origin="Generated by Gradle"/>
</artifact>
<artifact name="asm-tree-7.2.pom">
<sha256 value="56765f0a8bd0978214f7ec87a9dafb5825b8191cff554a5adc14c65d1f5b0442" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-tree" version="9.1">
<artifact name="asm-tree-9.1.jar">
<sha256 value="fd00afa49e9595d7646205b09cecb4a776a8ff0ba06f2d59b8f7bf9c704b4a73" origin="Generated by Gradle"/>
Expand Down
29 changes: 24 additions & 5 deletions src/main/java/co/rsk/federate/BtcToRskClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ public class BtcToRskClient implements BlockListener, TransactionListener {
public BtcToRskClient() {}

/// This constructor should only be used by tests.
public BtcToRskClient(
protected BtcToRskClient(
ActivationConfig activationConfig,
BitcoinWrapper bitcoinWrapper,
FederatorSupport federatorSupport,
BridgeConstants bridgeConstants,
BtcToRskClientFileStorage btcToRskClientFileStorage,
BtcLockSenderProvider btcLockSenderProvider,
PeginInstructionsProvider peginInstructionsProvider,
Federation federation,
boolean isUpdateBridgeTimerEnabled,
int amountOfHeadersToSend
) throws Exception {
Expand All @@ -87,6 +88,7 @@ public BtcToRskClient(
this.restoreFileData();
this.btcLockSenderProvider = btcLockSenderProvider;
this.peginInstructionsProvider = peginInstructionsProvider;
this.federation = federation;
this.isUpdateBridgeTimerEnabled = isUpdateBridgeTimerEnabled;
this.amountOfHeadersToSend = amountOfHeadersToSend;
}
Expand Down Expand Up @@ -140,10 +142,6 @@ public void start(Federation federation) {
public void stop() {
logger.info("Stopping");

if (federation != null) {
bitcoinWrapper.removeFederationListener(federation, this);
}

federation = null;

if (updateBridgeTimer != null) {
Expand Down Expand Up @@ -435,6 +433,15 @@ public void updateBridgeBtcTransactions() throws BlockStoreException {
int numberOfTxsSent = 0;
Set<Sha256Hash> txsToSendToRskHashes = this.fileData.getTransactionProofs().keySet();
logger.debug("[updateBridgeBtcTransactions] Tx count: {}", txsToSendToRskHashes.size());

co.rsk.bitcoinj.core.Context context = co.rsk.bitcoinj.core.Context.getOrCreate(bridgeConstants.getBtcParams());
co.rsk.bitcoinj.wallet.Wallet federationWallet = BridgeUtils.getFederationNoSpendWallet(
context,
federation,
false,
null
);

for (Sha256Hash txHash : txsToSendToRskHashes) {
Transaction tx = federatorWalletTxMap.get(txHash);
logger.debug("[updateBridgeBtcTransactions] Evaluating Btc Tx {}", txHash);
Expand All @@ -446,6 +453,18 @@ public void updateBridgeBtcTransactions() throws BlockStoreException {
logger.debug("[updateBridgeBtcTransactions] Got Btc Tx {} (wtxid:{})", tx.getTxId(), tx.getWTxId());
BtcTransaction btcTx = ThinConverter.toThinInstance(bridgeConstants.getBtcParams(), tx);

if (btcTx.getValueSentToMe(federationWallet).isZero()) {
// Remove the tx from the set to be sent to the Bridge since it's not processable
txsToSendToRskHashes.remove(txHash);

logger.warn(
"[updateBridgeBtcTransactions] Transaction hash {} does not have any output to the current federation {}",
btcTx.getHash(true),
federation.getAddress()
);
continue;
}

long bestBlockNumber = rskBlockchain.getBestBlock().getNumber();
PeginInformation peginInformation = new PeginInformation(
btcLockSenderProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public Federation getActiveFederation() {
creationBlockNumber,
federatorSupport.getBtcParams(),
bridgeConstants.getErpFedPubKeysList(),
bridgeConstants.getErpFedActivationDelay()
bridgeConstants.getErpFedActivationDelay(),
federatorSupport.getConfigForBestBlock()
);
}

Expand Down Expand Up @@ -153,7 +154,8 @@ public Optional<Federation> getRetiringFederation() {
creationBlockNumber,
federatorSupport.getBtcParams(),
bridgeConstants.getErpFedPubKeysList(),
bridgeConstants.getErpFedActivationDelay()
bridgeConstants.getErpFedActivationDelay(),
federatorSupport.getConfigForBestBlock()
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ protected void processReleases(Set<Map.Entry<Keccak256, BtcTransaction>> release
// TODO: Sorting and then looping again is not efficient but we are making a compromise on performance here as we don't have that many release txs
// Sort descending
releasesReadyToSign.sort((a, b) -> (int) (b.getBlock().getNumber() - a.getBlock().getNumber()));
// Sign
releasesReadyToSign.forEach(release -> signRelease(version, release));
// Sign only the first element
if (releasesReadyToSign.size() > 0) {
signRelease(version, releasesReadyToSign.get(0));
}
} catch (Exception e) {
logger.error("[processReleases] There was an error trying to process releases", e);
}
Expand Down
Loading

0 comments on commit de970f1

Please sign in to comment.