-// *
+// *
// * The value of the key will be updated only if it's latest version equals the
// * specified version argument.
// * If the key doesn't exist, it will be created when the version arg was -1.
// *
// * If updating is performed, the version of the key increase by 1.
// * If creating is performed, the version of the key initialize by 0.
-// *
+// *
// * @param key The key of data;
// * @param value The value of data;
// * @param version The expected latest version of the key.
@@ -279,14 +281,14 @@ public class MerkleDataSet implements Transactional, MerkleProvable, Dataset
- *
+ *
* The value of the key will be updated only if it's latest version equals the
* specified version argument.
* If the key doesn't exist, it will be created when the version arg was -1.
*
* If updating is performed, the version of the key increase by 1.
* If creating is performed, the version of the key initialize by 0.
- *
+ *
* @param key The key of data;
* @param value The value of data;
* @param version The expected latest version of the key.
@@ -342,7 +344,9 @@ public class MerkleDataSet implements Transactional, MerkleProvable, Dataset
* 但该版本有可能小于实际存储的最新版本(由于后续追加的新修改被之后生成的快照维护);
- *
+ *
* @param key
* @return 返回指定的键的版本;如果不存在,则返回 -1;
*/
@@ -396,10 +400,10 @@ public class MerkleDataSet implements Transactional, MerkleProvable, Dataset
-// *
+// *
// * If the key with the specified version doesn't exist, then return null;
// * If the version is specified to -1, then return the latest version's value;
-// *
+// *
// * @param key
// * @param version
// */
@@ -410,10 +414,10 @@ public class MerkleDataSet implements Transactional, MerkleProvable, Dataset
- *
+ *
* If the key with the specified version doesn't exist, then return null;
* If the version is specified to -1, then return the latest version's value;
- *
+ *
* @param key
* @param version
*/
@@ -432,7 +436,7 @@ public class MerkleDataSet implements Transactional, MerkleProvable, Dataset
- *
+ *
* 此方法会处理所有的异常,以不同结果的 {@link TransactionResponse} 返回;
- *
+ *
* @param request
* @param txCtx
* @return
@@ -299,7 +301,11 @@ public class TransactionBatchProcessor implements TransactionBatchProcess {
// 提交交易(事务);
result = TransactionState.SUCCESS;
+ LOGGER.debug("before commit(). --[BlockHeight={}][RequestHash={}][TxHash={}]",
+ newBlockEditor.getBlockHeight(), request.getHash(), request.getTransactionContent().getHash());
txCtx.commit(result, operationResults);
+ LOGGER.debug("after commit(). --[BlockHeight={}][RequestHash={}][TxHash={}]",
+ newBlockEditor.getBlockHeight(), request.getHash(), request.getTransactionContent().getHash());
} catch (TransactionRollbackException e) {
result = TransactionState.IGNORED_BY_TX_FULL_ROLLBACK;
txCtx.rollback();
@@ -372,7 +378,7 @@ public class TransactionBatchProcessor implements TransactionBatchProcess {
/**
* 直接丢弃交易;
- *
+ *
* @param request
* @param txState
* @return 丢弃交易的回复;只包含原始请求中的交易内容哈希和交易被丢弃的原因,而不包含区块信息;
@@ -390,7 +396,7 @@ public class TransactionBatchProcessor implements TransactionBatchProcess {
/*
* (non-Javadoc)
- *
+ *
* @see com.jd.blockchain.ledger.core.impl.TransactionBatchProcess#prepare()
*/
@Override
@@ -405,7 +411,7 @@ public class TransactionBatchProcessor implements TransactionBatchProcess {
/*
* (non-Javadoc)
- *
+ *
* @see
* com.jd.blockchain.ledger.core.impl.TransactionBatchProcess#cancel(com.jd.
* blockchain.ledger.ExecutionState)
diff --git a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/TransactionSet.java b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/TransactionSet.java
index fe336005..bd2450c5 100644
--- a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/TransactionSet.java
+++ b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/TransactionSet.java
@@ -12,9 +12,11 @@ import com.jd.blockchain.storage.service.ExPolicyKVStorage;
import com.jd.blockchain.storage.service.VersioningKVStorage;
import com.jd.blockchain.utils.Bytes;
import com.jd.blockchain.utils.Transactional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class TransactionSet implements Transactional, TransactionQuery {
-
+ private Logger logger = LoggerFactory.getLogger(TransactionSet.class);
static {
DataContractRegistry.register(LedgerTransaction.class);
}
@@ -67,7 +69,7 @@ public class TransactionSet implements Transactional, TransactionQuery {
/**
* Create a new TransactionSet which can be added transaction;
- *
+ *
* @param setting
* @param merkleTreeStorage
* @param dataStorage
@@ -80,7 +82,7 @@ public class TransactionSet implements Transactional, TransactionQuery {
/**
* Create TransactionSet which is readonly to the history transactions;
- *
+ *
* @param setting
* @param merkleTreeStorage
* @param dataStorage
diff --git a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/AbstractLedgerOperationHandle.java b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/AbstractLedgerOperationHandle.java
index 2b259d4a..e941cadc 100644
--- a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/AbstractLedgerOperationHandle.java
+++ b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/AbstractLedgerOperationHandle.java
@@ -12,16 +12,18 @@ import com.jd.blockchain.ledger.core.OperationHandleContext;
import com.jd.blockchain.ledger.core.SecurityContext;
import com.jd.blockchain.ledger.core.SecurityPolicy;
import com.jd.blockchain.ledger.core.TransactionRequestExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* 执行直接账本操作的处理类;
- *
+ *
* @author huanghaiquan
*
* @param
*/
public abstract class AbstractLedgerOperationHandle implements OperationHandle {
-
+ private Logger logger = LoggerFactory.getLogger(this.getClass());
static {
DataContractRegistry.register(BytesValue.class);
}
@@ -52,8 +54,11 @@ public abstract class AbstractLedgerOperationHandle impleme
// 操作账本;
@SuppressWarnings("unchecked")
T concretedOp = (T) op;
+ logger.debug("before doProcess()... --[RequestHash={}][TxHash={}]",
+ requestContext.getHash(), requestContext.getTransactionContent().getHash());
doProcess(concretedOp, newBlockDataset, requestContext, ledger, handleContext);
-
+ logger.debug("after doProcess()... --[RequestHash={}][TxHash={}]",
+ requestContext.getHash(), requestContext.getTransactionContent().getHash());
// 账本操作没有返回值;
return null;
}
diff --git a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/DataAccountRegisterOperationHandle.java b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/DataAccountRegisterOperationHandle.java
index ab852255..728f9b6f 100644
--- a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/DataAccountRegisterOperationHandle.java
+++ b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/DataAccountRegisterOperationHandle.java
@@ -10,9 +10,11 @@ import com.jd.blockchain.ledger.core.OperationHandleContext;
import com.jd.blockchain.ledger.core.SecurityContext;
import com.jd.blockchain.ledger.core.SecurityPolicy;
import com.jd.blockchain.ledger.core.TransactionRequestExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class DataAccountRegisterOperationHandle extends AbstractLedgerOperationHandle {
-
+ private Logger logger = LoggerFactory.getLogger(this.getClass());
public DataAccountRegisterOperationHandle() {
super(DataAccountRegisterOperation.class);
}
@@ -29,7 +31,9 @@ public class DataAccountRegisterOperationHandle extends AbstractLedgerOperationH
// 操作账本;
DataAccountRegisterOperation dataAccountRegOp = (DataAccountRegisterOperation) op;
BlockchainIdentity bid = dataAccountRegOp.getAccountID();
+ logger.debug("before register.[dataAddress={}]",bid.getAddress());
newBlockDataset.getDataAccountSet().register(bid.getAddress(), bid.getPubKey(), null);
+ logger.debug("after register.[dataAddress={}]",bid.getAddress());
}
}
diff --git a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/RolesConfigureOperationHandle.java b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/RolesConfigureOperationHandle.java
index 1d3c472c..16408348 100644
--- a/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/RolesConfigureOperationHandle.java
+++ b/source/ledger/ledger-core/src/main/java/com/jd/blockchain/ledger/core/handles/RolesConfigureOperationHandle.java
@@ -41,6 +41,7 @@ public class RolesConfigureOperationHandle extends AbstractLedgerOperationHandle
rp.disable(rpcfg.getDisableLedgerPermissions());
rp.disable(rpcfg.getDisableTransactionPermissions());
+ rpSettings.updateRolePrivilege(rp);
}
}
}
diff --git a/source/peer/src/main/java/com/jd/blockchain/peer/consensus/ConsensusMessageDispatcher.java b/source/peer/src/main/java/com/jd/blockchain/peer/consensus/ConsensusMessageDispatcher.java
index 6b8967f6..c5b0e015 100644
--- a/source/peer/src/main/java/com/jd/blockchain/peer/consensus/ConsensusMessageDispatcher.java
+++ b/source/peer/src/main/java/com/jd/blockchain/peer/consensus/ConsensusMessageDispatcher.java
@@ -14,6 +14,8 @@ import com.jd.blockchain.service.TransactionEngine;
import com.jd.blockchain.utils.codec.Base58Utils;
import com.jd.blockchain.utils.concurrent.AsyncFuture;
import com.jd.blockchain.utils.concurrent.CompletableAsyncFuture;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -37,7 +39,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/
@Component
public class ConsensusMessageDispatcher implements MessageHandle {
-
+ private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private TransactionEngine txEngine;
@@ -119,7 +121,9 @@ public class ConsensusMessageDispatcher implements MessageHandle {
if (!realmProcessor.getCurrBatchId().equalsIgnoreCase(batchId)) {
throw new IllegalArgumentException("BatchId is not begin!");
}
+ logger.debug("before realmProcessor.commit(),[batchId={}]",batchId);
realmProcessor.commit();
+ logger.debug("after realmProcessor.commit(),[batchId={}]",batchId);
// realmProcessorMap.remove(realmName);
}